Exemple #1
0
    def test_remove_success(self):
        # Arrange
        mp = Map("Test map", "")
        store = MapStore()
        store.add(mp)

        # Act
        store.remove(mp)

        # Assert
        self.assertEqual(store.list_all(), [])
Exemple #2
0
    def test_list_all(self):
        # Arrange
        mp1 = Map("Test map 1", "")
        mp2 = Map("Test map 2", "")
        store = MapStore()
        store.add(mp1)
        store.add(mp2)

        # Act
        act = store.list_all()

        #Assert
        self.assertEqual(act, ["Test map 1", "Test map 2"])
Exemple #3
0
    def test_add_map(self):
        #Arrange
        m = Map("mappy", "somefilepath")
        mStore = MapStore()

        #Act
        mStore.add(m)

        #Assert
        listy = []

        for i in mStore.list_all():
            listy.append(mStore.get(i))

        self.assertIn(m, listy)
Exemple #4
0
    def test_list_all(self):
        #Arrange
        m = Map("mappy", "somefilepath")
        n = Map("flappy", "anotherfilepath")
        mStore = MapStore()

        mStore.add(m)
        mStore.add(n)

        #Act and Assert
        listy = []

        for i in mStore.list_all():
            listy.append(mStore.get(i))

        self.assertIn(m, listy)
        self.assertIn(n, listy)