Exemplo n.º 1
0
 def test_invalid_type_int(self):
     option = config_options.Nav()
     with self.assertRaises(config_options.ValidationError) as cm:
         option.validate(5)
     self.assertEqual(str(cm.exception), "Expected nav to be a list, got a int: 5")
Exemplo n.º 2
0
 def test_invalid_item_none(self):
     option = config_options.Nav()
     with self.assertRaises(config_options.ValidationError) as cm:
         option.validate([None])
     self.assertEqual(str(cm.exception), "Expected nav item to be a string or dict, got None")
Exemplo n.º 3
0
 def test_old_format(self):
     option = config_options.Nav()
     with self.assertRaises(config_options.ValidationError) as cm:
         option.validate([['index.md']])
     self.assertEqual(str(cm.exception), "Expected nav item to be a string or dict, got a list: ['index.md']")