def test_make_new_build_number(self):
     ver_s = VerStruct.current()
     ver_s.build_number = VerStruct.make_new_build_number()
     self.assertTrue(
         ver_s.is_valid(),
         "VerStruct.get_build_number_datetime does not generate vaild build numbers"
     )
    def test_repr_makes_struct_in_eval(self):
        ver_s = VerStruct.current()

        try:
            VerStruct(*eval(repr(ver_s)))
        except Exception as e:
            assert False, f"repr of VerStruct was unable to turn back into a VerStruct: {repr(ver_s)}"
 def test_repr_makes_struct_in_eval(self):
     ver_s = VerStruct.current()
     
     try:
         VerStruct(*eval(repr(ver_s)))
     except:
         self.assertTrue(False,"repr of VerStruct was unable to turn back into a VerStruct: %s" % repr(ver_s))
    def test_repr_makes_struct_in_eval(self):
        ver_s = VerStruct.current()

        try:
            VerStruct(*eval(repr(ver_s)))
        except:
            self.assertTrue(
                False,
                "repr of VerStruct was unable to turn back into a VerStruct: %s"
                % repr(ver_s))
Beispiel #5
0
        def try_asserts():
            current = xplane_helpers.VerStruct.current()
            self.assertTrue(
                bpy.context.scene['xplane2blender_version'] ==
                xplane_constants.DEPRECATED_XP2B_VER,
                "scene['xplane2blender_version'] was not deprecated on load")

            history = bpy.context.scene.xplane.xplane2blender_ver_history
            self.assertTrue(
                len(history) == 2,
                'xplane2blender_ver_history is %d long == not 2' %
                (len(history)))

            self.assertTrue(
                history[0].make_struct() == VerStruct.parse_version(to_parse),
                'First entry in history %s is wrong or not the legacy string' %
                str(history[0]))

            self.assertTrue(
                history[1].make_struct() == VerStruct.current(),
                'Second entry in history %s is wrong' % str(history[1]))
 def test_make_new_build_number(self):
     ver_s = VerStruct.current()
     ver_s.build_number = VerStruct.make_new_build_number()
     self.assertTrue(ver_s.is_valid(), "VerStruct.make_new_build_number does not generate vaild build numbers")