mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-09 07:56:22 -06:00
Also rename test
Forgot that, sorry. Contributes to issue CURA-3427.
This commit is contained in:
parent
b57cb16f6d
commit
833ad65507
1 changed files with 5 additions and 5 deletions
|
@ -9,7 +9,7 @@ import VersionUpgrade24to25 #The module we're testing.
|
||||||
## Creates an instance of the upgrader to test with.
|
## Creates an instance of the upgrader to test with.
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def upgrader():
|
def upgrader():
|
||||||
return VersionUpgrade24to25.VersionUpgrade24to25()
|
return VersionUpgrade25to26.VersionUpgrade25to26()
|
||||||
|
|
||||||
test_cfg_version_good_data = [
|
test_cfg_version_good_data = [
|
||||||
{
|
{
|
||||||
|
@ -121,7 +121,7 @@ foo = bar
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
## Tests whether the settings that should be removed are removed for the 2.5
|
## Tests whether the settings that should be removed are removed for the 2.6
|
||||||
# version of preferences.
|
# version of preferences.
|
||||||
@pytest.mark.parametrize("data", test_upgrade_preferences_removed_settings_data)
|
@pytest.mark.parametrize("data", test_upgrade_preferences_removed_settings_data)
|
||||||
def test_upgradePreferencesRemovedSettings(data, upgrader):
|
def test_upgradePreferencesRemovedSettings(data, upgrader):
|
||||||
|
@ -137,7 +137,7 @@ def test_upgradePreferencesRemovedSettings(data, upgrader):
|
||||||
upgraded_preferences = upgraded_preferences[0]
|
upgraded_preferences = upgraded_preferences[0]
|
||||||
|
|
||||||
#Find whether the removed setting is removed from the file now.
|
#Find whether the removed setting is removed from the file now.
|
||||||
settings -= VersionUpgrade24to25._removed_settings
|
settings -= VersionUpgrade25to26._removed_settings
|
||||||
parser = configparser.ConfigParser(interpolation = None)
|
parser = configparser.ConfigParser(interpolation = None)
|
||||||
parser.read_string(upgraded_preferences)
|
parser.read_string(upgraded_preferences)
|
||||||
assert (parser.has_section("general") and "visible_settings" in parser["general"]) == (len(settings) > 0) #If there are settings, there must also be a preference.
|
assert (parser.has_section("general") and "visible_settings" in parser["general"]) == (len(settings) > 0) #If there are settings, there must also be a preference.
|
||||||
|
@ -166,7 +166,7 @@ type = instance_container
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
## Tests whether the settings that should be removed are removed for the 2.5
|
## Tests whether the settings that should be removed are removed for the 2.6
|
||||||
# version of instance containers.
|
# version of instance containers.
|
||||||
@pytest.mark.parametrize("data", test_upgrade_instance_container_removed_settings_data)
|
@pytest.mark.parametrize("data", test_upgrade_instance_container_removed_settings_data)
|
||||||
def test_upgradeInstanceContainerRemovedSettings(data, upgrader):
|
def test_upgradeInstanceContainerRemovedSettings(data, upgrader):
|
||||||
|
@ -182,7 +182,7 @@ def test_upgradeInstanceContainerRemovedSettings(data, upgrader):
|
||||||
upgraded_container = upgraded_container[0]
|
upgraded_container = upgraded_container[0]
|
||||||
|
|
||||||
#Find whether the forbidden setting is still in the container.
|
#Find whether the forbidden setting is still in the container.
|
||||||
settings -= VersionUpgrade24to25._removed_settings
|
settings -= VersionUpgrade25to26._removed_settings
|
||||||
parser = configparser.ConfigParser(interpolation = None)
|
parser = configparser.ConfigParser(interpolation = None)
|
||||||
parser.read_string(upgraded_container)
|
parser.read_string(upgraded_container)
|
||||||
assert parser.has_section("values") == (len(settings) > 0) #If there are settings, there must also be the values category.
|
assert parser.has_section("values") == (len(settings) > 0) #If there are settings, there must also be the values category.
|
Loading…
Add table
Add a link
Reference in a new issue