new profile carousel implementation reacts to new profiles

This commit is contained in:
Jakob Ketterl
2021-03-05 18:57:09 +01:00
parent a3cfde02c4
commit 2ba2ec38e0
3 changed files with 50 additions and 15 deletions

View File

@ -76,3 +76,19 @@ class PropertyCarouselTest(TestCase):
pc = PropertyCarousel()
with self.assertRaises(KeyError):
pc.switch("doesntmatter")
def testHasLayer(self):
pc = PropertyCarousel()
pc.addLayer("testkey", PropertyLayer())
self.assertTrue(pc.hasLayer("testkey"))
self.assertFalse(pc.hasLayer("otherkey"))
def testRemoveLayer(self):
pc = PropertyCarousel()
pl = PropertyLayer(testkey="testvalue")
pc.addLayer("x", pl)
pc.switch("x")
self.assertEqual(pc["testkey"], "testvalue")
pc.removeLayer("x")
with self.assertRaises(KeyError):
pc.switch("x")