Beispiel #1
0
    def test_add_success(self):
        # Arrange
        dr = Drone("drone123")
        store = DroneStore()

        # Act
        store.add(dr)

        # Assert
        self.assertEqual(dr, store.get(dr.id))
Beispiel #2
0
    def test_add_success(self):
        # Arrange
        dr = Drone("Test drone")
        store = DroneStore()

        # Act
        store.add(dr)

        # Assert
        self.assertEqual(store.get(1), dr)
Beispiel #3
0
    def test_droneRemove(self):
        #Arrange
        store = DroneStore()
        dr = Drone("Test")
        dr2 = Drone("Test2")
        dr3 = Drone("Test3")
        
        store.add(dr)
        store.add(dr2)
        
        #Act
        store.remove(dr2)

        #Assert
        listy = []
        for i in store.list_all():
            listy.append(store.get(i))

        self.assertIn(dr, listy)
        self.assertNotIn(dr2, listy)
Beispiel #4
0
    def test_droneAdd(self):
        # Arrange
        dr = Drone("Tester")
        dr2 = Drone("Tester2")
        dr3 = Drone("Tester3")
        dr4 = Drone("Tester3")
        store = DroneStore()

        #Act
        store.add(dr)
        store.add(dr2)
        store.add(dr3)

        listy = []
        
        #Assert
        for i in store.list_all():
            listy.append(store.get(i))

        self.assertIn(dr, listy)
        self.assertIn(dr2, listy)
        self.assertIn(dr3, listy)
        self.assertNotIn(dr4, listy)