TestProfileRequirements.py 1.3 KB

12345678910111213141516171819202122232425
  1. import configparser #To read the profiles.
  2. import os #To join paths.
  3. import pytest
  4. ## Makes sure that the variants for the Ultimaker 3 Extended are exactly the
  5. # same as for the Ultimaker 3.
  6. #
  7. # Once we have specialised profiles or a mechanism to inherit variants too, we
  8. # may remove this test and have different profiles for the extended where
  9. # needed, but until then we should keep them the same. It's happened all too
  10. # often that we updated the variants for the UM3 but forgot about the UM3E.
  11. @pytest.mark.parametrize("um3_file, um3e_file", [
  12. #List the corresponding files below.
  13. ("ultimaker3_aa0.8.inst.cfg", "ultimaker3_extended_aa0.8.inst.cfg"),
  14. ("ultimaker3_aa04.inst.cfg", "ultimaker3_extended_aa04.inst.cfg"),
  15. ("ultimaker3_bb0.8.inst.cfg", "ultimaker3_extended_bb0.8.inst.cfg"),
  16. ("ultimaker3_bb04.inst.cfg", "ultimaker3_extended_bb04.inst.cfg")
  17. ])
  18. def test_ultimaker3extended_variants(um3_file, um3e_file):
  19. directory = os.path.join(os.path.dirname(__file__), "..", "resources", "variants") #TODO: Hardcoded path relative to this test file.
  20. um3 = configparser.ConfigParser()
  21. um3.read_file(open(os.path.join(directory, um3_file)))
  22. um3e = configparser.ConfigParser()
  23. um3e.read_file(open(os.path.join(directory, um3e_file)))
  24. assert um3["values"] == um3e["values"]