def test_load(self): with self.subTest("normal (with explicit call of load())"): with self.recorder.use_cassette('cache_explicit_load'): cache = Cache(self.gc, "GC4808G") cache.load() self.assertEqual("Nekonecne ticho", cache.name) with self.subTest("normal"): with self.recorder.use_cassette('cache_normal_normal'): cache = Cache(self.gc, "GC4808G") self.assertEqual("Nekonecne ticho", cache.name) with self.subTest("non-ascii chars"): with self.recorder.use_cassette('cache_non-ascii'): cache = Cache(self.gc, "GC5VJ0P") self.assertEqual("u parezové chaloupky", cache.hint) with self.subTest("PM only"): with self.recorder.use_cassette('cache_PMO'): with self.assertRaises(PMOnlyException): cache = Cache(self.gc, "GC3AHDM") cache.load() with self.subTest("fail"): with self.recorder.use_cassette('cache_normal_fail'): with self.assertRaises(LoadError): cache = Cache(self.gc, "GC123456") cache.load()
def test_load(self): with self.subTest("normal (with explicit call of load())"): cache = Cache(self.gc, "GC4808G") cache.load() self.assertEqual("Nekonecne ticho", cache.name) with self.subTest("normal"): cache = Cache(self.gc, "GC4808G") self.assertEqual("Nekonecne ticho", cache.name) with self.subTest("non-ascii chars"): cache = Cache(self.gc, "GC4FRG5") self.assertEqual("Entre l'arbre et la grille.", cache.hint) with self.subTest("PM only"): with self.assertRaises(PMOnlyException): cache = Cache(self.gc, "GC3AHDM") cache.load() with self.subTest("fail"): with self.assertRaises(LoadError): cache = Cache(self.gc, "GC123456") cache.load()