Beispiel #1
0
    def setUp(self):
        super(ClientWithFewAddressTest, self).setUp()
        self.client = BaseTestFactory.create_client_with_3_address()
        self.dict_client = self.client.as_dict()

        self.return_client = ClientWithAddress()
        self.return_client.map_dict(self.dict_client)
Beispiel #2
0
class ClientWithFewAddressTest(unittest.TestCase):
    def setUp(self):
        super(ClientWithFewAddressTest, self).setUp()
        self.client = BaseTestFactory.create_client_with_3_address()
        self.dict_client = self.client.as_dict()

        self.return_client = ClientWithAddress()
        self.return_client.map_dict(self.dict_client)

    def test_client_name_mapping(self):
        self.assertEqual(self.client.name, self.return_client.name,
                         " name not mapped")

    def test_client_last_name_mapping(self):
        self.assertEqual(self.client.last_name, self.return_client.last_name,
                         " last_name not mapped")

    def test_client_address1_mapping(self):
        cl_addr_1 = self.client.address[0]
        rt_addr_1 = self.return_client.address[0]
        self.assertTrue(compare_objs(cl_addr_1, rt_addr_1),
                        "cl_addr_1 and rt_addr_1 are diferent")

    def test_client_address2_mapping(self):
        cl_addr_2 = self.client.address[1]
        rt_addr_2 = self.return_client.address[1]
        self.assertTrue(compare_objs(cl_addr_2, rt_addr_2),
                        "cl_addr_2 and rt_addr_2 are diferent")

    def test_client_address3_mapping(self):
        cl_addr_3 = self.client.address[2]
        rt_addr_3 = self.return_client.address[2]
        self.assertTrue(compare_objs(cl_addr_3, rt_addr_3),
                        "cl_addr_3 and rt_addr_3 are diferent")
class ClientWithFewAddressTest(unittest.TestCase):
    def setUp(self):
        super(ClientWithFewAddressTest, self).setUp()
        self.client = BaseTestFactory.create_client_with_3_address()
        self.dict_client = self.client.as_dict()

        self.return_client = ClientWithAddress()
        self.return_client.map_dict(self.dict_client)

    def test_client_name_mapping(self):
        self.assertEqual(self.client.name, self.return_client.name, " name not mapped")

    def test_client_last_name_mapping(self):
        self.assertEqual(self.client.last_name, self.return_client.last_name, " last_name not mapped")

    def test_client_address1_mapping(self):
        cl_addr_1 = self.client.address[0]
        rt_addr_1 = self.return_client.address[0]
        self.assertTrue(compare_objs(cl_addr_1, rt_addr_1), "cl_addr_1 and rt_addr_1 are diferent")

    def test_client_address2_mapping(self):
        cl_addr_2 = self.client.address[1]
        rt_addr_2 = self.return_client.address[1]
        self.assertTrue(compare_objs(cl_addr_2, rt_addr_2), "cl_addr_2 and rt_addr_2 are diferent")

    def test_client_address3_mapping(self):
        cl_addr_3 = self.client.address[2]
        rt_addr_3 = self.return_client.address[2]
        self.assertTrue(compare_objs(cl_addr_3, rt_addr_3), "cl_addr_3 and rt_addr_3 are diferent")
    def setUp(self):
        super(ClientWithFewAddressTest, self).setUp()
        self.client = BaseTestFactory.create_client_with_3_address()
        self.dict_client = self.client.as_dict()

        self.return_client = ClientWithAddress()
        self.return_client.map_dict(self.dict_client)