Esempio n. 1
0
    def test_getDataObject_givenData_expectGivenInputData(
            self):
        data = [1, 2, 3, 4]
        dataCollection = DataCollection()
        dataCollection.setDataObject(data, "test")

        self.assertEqual(dataCollection.getDataObject("test"), data)
Esempio n. 2
0
    def test_getStandardData_givenData_expectGivenInputData(
            self):
        data = [1, 2, 3, 4]
        dataCollection = DataCollection()
        dataCollection.setStandardData(data)

        self.assertEqual(dataCollection.getStandardData(), data)
Esempio n. 3
0
    def test_getStandardDataName_givenValidName_expectGivenName(
            self):
        dataCollection = DataCollection()
        dataCollection.setStandardDataName("testName")

        self.assertEqual(dataCollection.getStandardDataName(), "testName")
Esempio n. 4
0
    def test_getStandardDataName_givenDefaultName_expectDefaultName(
            self):
        dataCollection = DataCollection()

        self.assertEqual(dataCollection.getStandardDataName(), "data")
Esempio n. 5
0
 def test_setStandardDataName_givenEmptyName_expectException(
         self):
     dataCollection = DataCollection()
     self.assertRaises(
         RuntimeError, lambda: dataCollection.setStandardDataName(""))
Esempio n. 6
0
    def test_getDataObject_givenNonExistingName_expectException(
            self):
        dataCollection = DataCollection()

        self.assertRaises(
            KeyError, lambda: dataCollection.getDataObject("noExisting"))
Esempio n. 7
0
    def test_getDataObject_givenEmptyName_expectException(
            self):
        dataCollection = DataCollection()

        self.assertRaises(
            KeyError, lambda: dataCollection.getDataObject(""))
Esempio n. 8
0
    def test_init_givenNoStandardData_expectNoException(self):
        dataCollection = DataCollection()

        self.assertIsInstance(dataCollection, DataCollection)
        self.assertEqual(dataCollection.getStandardDataName(), "data")
        self.assertEqual(dataCollection.getStandardData(), None)
Esempio n. 9
0
 def test_setDataObject_givenEmptyName_expectException(
         self):
     data = [1, 2, 3, 4]
     dataCollection = DataCollection()
     self.assertRaises(
         RuntimeError, lambda: dataCollection.setDataObject(data,""))
Esempio n. 10
0
    def test_init_givenStandardData_expectNoException(self):
        data = [1, 2, 3, 4]
        dataCollection = DataCollection(data)

        self.assertIsInstance(dataCollection, DataCollection)
        self.assertEqual(dataCollection.getStandardData(), data)