Remove unneeded unit tests

The code was moved to uranium, so no need to test them in a plugin.

In some cases they were also testing a specific implementation artifact and not
actual expected behavior.

CURA-7388
This commit is contained in:
Jaime van Kessel 2020-04-28 10:23:36 +02:00
parent f4f990708f
commit 174b58374a
No known key found for this signature in database
GPG key ID: 3710727397403C91
2 changed files with 0 additions and 140 deletions

View file

@ -63,74 +63,6 @@ setting_version = -3
}
]
## Tests the technique that gets the version number from CFG files.
#
# \param data The parametrised data to test with. It contains a test name
# to debug with, the serialised contents of a CFG file and the correct
# version number in that CFG file.
# \param upgrader The instance of the upgrade class to test.
@pytest.mark.parametrize("data", test_cfg_version_good_data)
def test_cfgVersionGood(data, upgrader):
version = upgrader.getCfgVersion(data["file_data"])
assert version == data["version"]
test_cfg_version_bad_data = [
{
"test_name": "Empty",
"file_data": "",
"exception": configparser.Error #Explicitly not specified further which specific error we're getting, because that depends on the implementation of configparser.
},
{
"test_name": "No General",
"file_data": """[values]
layer_height = 0.1337
""",
"exception": configparser.Error
},
{
"test_name": "No Version",
"file_data": """[general]
true = false
""",
"exception": configparser.Error
},
{
"test_name": "Not a Number",
"file_data": """[general]
version = not-a-text-version-number
""",
"exception": ValueError
},
{
"test_name": "Setting Value NaN",
"file_data": """[general]
version = 4
[metadata]
setting_version = latest_or_something
""",
"exception": ValueError
},
{
"test_name": "Major-Minor",
"file_data": """[general]
version = 1.2
""",
"exception": ValueError
}
]
## Tests whether getting a version number from bad CFG files gives an
# exception.
#
# \param data The parametrised data to test with. It contains a test name
# to debug with, the serialised contents of a CFG file and the class of
# exception it needs to throw.
# \param upgrader The instance of the upgrader to test.
@pytest.mark.parametrize("data", test_cfg_version_bad_data)
def test_cfgVersionBad(data, upgrader):
with pytest.raises(data["exception"]):
upgrader.getCfgVersion(data["file_data"])
test_upgrade_preferences_removed_settings_data = [
{
"test_name": "Removed Setting",

View file

@ -35,13 +35,6 @@ infill_sparse_density = 42
""",
"version": 3000000
},
{
"test_name": "Negative Version", #Why not?
"file_data": """[general]
version = -20
""",
"version": -20000000
},
{
"test_name": "Setting Version",
"file_data": """[general]
@ -50,15 +43,6 @@ version = 1
setting_version = 1
""",
"version": 1000001
},
{
"test_name": "Negative Setting Version",
"file_data": """[general]
version = 1
[metadata]
setting_version = -3
""",
"version": 999997
}
]
@ -73,62 +57,6 @@ def test_cfgVersionGood(data, upgrader):
version = upgrader.getCfgVersion(data["file_data"])
assert version == data["version"]
test_cfg_version_bad_data = [
{
"test_name": "Empty",
"file_data": "",
"exception": configparser.Error #Explicitly not specified further which specific error we're getting, because that depends on the implementation of configparser.
},
{
"test_name": "No General",
"file_data": """[values]
layer_height = 0.1337
""",
"exception": configparser.Error
},
{
"test_name": "No Version",
"file_data": """[general]
true = false
""",
"exception": configparser.Error
},
{
"test_name": "Not a Number",
"file_data": """[general]
version = not-a-text-version-number
""",
"exception": ValueError
},
{
"test_name": "Setting Value NaN",
"file_data": """[general]
version = 4
[metadata]
setting_version = latest_or_something
""",
"exception": ValueError
},
{
"test_name": "Major-Minor",
"file_data": """[general]
version = 1.2
""",
"exception": ValueError
}
]
## Tests whether getting a version number from bad CFG files gives an
# exception.
#
# \param data The parametrised data to test with. It contains a test name
# to debug with, the serialised contents of a CFG file and the class of
# exception it needs to throw.
# \param upgrader The instance of the upgrader to test.
@pytest.mark.parametrize("data", test_cfg_version_bad_data)
def test_cfgVersionBad(data, upgrader):
with pytest.raises(data["exception"]):
upgrader.getCfgVersion(data["file_data"])
test_upgrade_stacks_with_not_supported_data = [
{