Ejemplo 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)
Ejemplo n.º 2
0
    def test_getStandardData_givenData_expectGivenInputData(
            self):
        data = [1, 2, 3, 4]
        dataCollection = DataCollection()
        dataCollection.setStandardData(data)

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

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

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

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

        self.assertRaises(
            KeyError, lambda: dataCollection.getDataObject(""))
Ejemplo 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)
Ejemplo n.º 9
0
 def test_setDataObject_givenEmptyName_expectException(
         self):
     data = [1, 2, 3, 4]
     dataCollection = DataCollection()
     self.assertRaises(
         RuntimeError, lambda: dataCollection.setDataObject(data,""))
Ejemplo 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)