class SystemIDTest(unittest.TestCase):

    def setUp(self):
        self.sut = SystemID("open_gl", "CPP")

    def test_set_generic_system(self):
        self.sut.set_generic_system()
        self.assertEquals(self.sut.language_version, Version())

    def test_version_id_setter_exception(self):
        self.assertRaises(ValueError, self.sut.version_id, 1)

    def test_version_id_setter_with_version_instance(self):
        self.sut.version_id = Version()

    def test_version_id_setter_with_string(self):
        self.sut.version_id = "1"

    def test_language_version_id_setter_with_version_instance(self):
        self.sut.language_version = Version()
        self.assertEquals(self.sut.language_version, Version())

    def test_language_version_id_setter_with_string(self):
        self.sut.language_version = "1"
        self.assertEquals(self.sut.language_version, Version("1"))

    def test_equal(self):
        self.assertTrue(self.sut == self.sut)
        self.assertFalse(self.sut == 1)
示例#2
0
class SystemIDTest(unittest.TestCase):
    def setUp(self):
        self.sut = SystemID("open_gl", "CPP")

    def test_set_generic_system(self):
        self.sut.set_generic_system()
        self.assertEquals(self.sut.language_version, Version())

    def test_version_id_setter_exception(self):
        self.assertRaises(ValueError, self.sut.version_id, 1)

    def test_version_id_setter_with_version_instance(self):
        self.sut.version_id = Version()

    def test_version_id_setter_with_string(self):
        self.sut.version_id = "1"

    def test_language_version_id_setter_with_version_instance(self):
        self.sut.language_version = Version()
        self.assertEquals(self.sut.language_version, Version())

    def test_language_version_id_setter_with_string(self):
        self.sut.language_version = "1"
        self.assertEquals(self.sut.language_version, Version("1"))

    def test_equal(self):
        self.assertTrue(self.sut == self.sut)
        self.assertFalse(self.sut == 1)
 def deserialize(data):
     '''From dictionary to object '''
     sr_id = SystemID.deserialize(data[SystemResourceNames.SERIAL_ID_KEY])
     ret = SystemResourceNames(sr_id)
     ldeserializer = ListDeserializer(SystemCellName)
     ret._names = ldeserializer.deserialize(data[SystemResourceNames.SERIAL_NAMES_KEY])
     return ret
示例#4
0
 def deserialize(data):
     '''From dictionary to object '''
     sr_id = SystemID.deserialize(data[SystemResourceNames.SERIAL_ID_KEY])
     ret = SystemResourceNames(sr_id)
     ldeserializer = ListDeserializer(SystemCellName)
     ret._names = ldeserializer.deserialize(
         data[SystemResourceNames.SERIAL_NAMES_KEY])
     return ret
 def setUp(self):
     self.sut = SystemID("open_gl", "CPP")
示例#6
0
 def setUp(self):
     self.sut = SystemID("open_gl", "CPP")
 def setUp(self):
     self.sut = SystemResourceNames(SystemID("open_gl", "CPP"))
 def test_eq_false(self):
     system_resource_names = SystemResourceNames(SystemID("open_gl", "CPP"))
     system_resource_names.add_names(["stdio"])
     self.assertFalse(self.sut.__eq__(system_resource_names))
     self.assertFalse(self.sut.__eq__(""))
 def test_eq_true(self):
     self.assertTrue(self.sut.__eq__(self.sut))
     self.assertTrue(self.sut.__eq__(SystemResourceNames(SystemID("open_gl", "CPP"))))