示例#1
0
    def test_Stub(self):
        readCSVFile = ReadCSVFile()
        customerDatabaseMapping = CustomerDatabaseMapping()

        customerDatabaseMapping.setConfig(ConfigStub.ConfigStub())
        customerDatabaseMapping.dataSourceFields = []

        result = customerDatabaseMapping.getCustomerData()
        self.assertEqual(
            ('*****@*****.**', 'Derek', 'Somerville', '1234'),
            result[0])
示例#2
0
    def test_Mock(self):
        readCSVFile = ReadCSVFile()
        customerDatabaseMapping = CustomerDatabaseMapping()

        MockData = []
        MockData.append("*****@*****.**")
        MockData.append("Derek")
        MockData.append("Somerville")
        MockData.append("1234")

        customerDatabaseMapping.config.getConfig = MagicMock(
            return_value=MockData)
        customerDatabaseMapping.dataSourceFields = []

        result = customerDatabaseMapping.getCustomerData()
        self.assertEqual(
            ('*****@*****.**', 'Derek', 'Somerville', '1234'),
            result[0])
示例#3
0
 def test_getCustomerDataFromDatabase(self):
     customerDatabaseMapping = CustomerDatabaseMapping()
     customerData = customerDatabaseMapping.getCustomerData()
     self.assertEqual(
         customerData[0],
         ('*****@*****.**', 'Derek', 'Somerville', '1234'))