Exemplo n.º 1
0
 def test_create_uses_fallback(self):
     self.assertEqual(
         Options.create(
             {
                 "header-one": "h1",
                 "fallback": "div"
             },
             "header-two",
             "fallback",
         ),
         Options("header-two", "div"),
     )
Exemplo n.º 2
0
 def test_create_raises_missing_element(self):
     with self.assertRaises(ConfigException):
         Options.create({"header-one": {}}, "header-one", "fallback")
Exemplo n.º 3
0
 def test_create_raises_missing_type(self):
     with self.assertRaises(ConfigException):
         Options.create({"header-one": "h1"}, "header-two", "fallback")
Exemplo n.º 4
0
 def test_create_simplest(self):
     self.assertEqual(
         Options.create({"unordered-list-item": "li"},
                        "unordered-list-item", "fallback"),
         Options("unordered-list-item", "li"),
     )
Exemplo n.º 5
0
 def test_create_raises_missing_element(self):
     with self.assertRaises(ConfigException):
         Options.create({'header-one': {}}, 'header-one', 'fallback')
Exemplo n.º 6
0
 def test_create_raises_missing_type(self):
     with self.assertRaises(ConfigException):
         Options.create({'header-one': 'h1'}, 'header-two', 'fallback')
Exemplo n.º 7
0
 def test_create_uses_fallback(self):
     self.assertEqual(
         Options.create({
             'header-one': 'h1',
             'fallback': 'div'
         }, 'header-two', 'fallback'), Options('header-two', 'div'))
Exemplo n.º 8
0
 def test_create_simplest(self):
     self.assertEqual(
         Options.create({'unordered-list-item': 'li'},
                        'unordered-list-item', 'fallback'),
         Options('unordered-list-item', 'li'))