Ejemplo n.º 1
0
 def test_path_not_there(self):
     invalid = self.dir.getpath('foo')
     text = "'%s' does not exist for dictionary value @ data['path']" % (
         invalid
     )
     with ShouldFailSchemaWith(text):
         Plugin.schema(dict(type='jenkins', path=invalid))
Ejemplo n.º 2
0
 def test_schema_min(self):
     compare(
         dict(type='jenkins', name='jenkins',
              repo='config', path=self.dir.path),
         actual=Plugin.schema(
             dict(type='jenkins', repo='config',
                  path=self.dir.path)
         ))
Ejemplo n.º 3
0
 def test_path_not_string(self):
     text = "expected str for dictionary value @ data['path']"
     with ShouldFailSchemaWith(text):
         Plugin.schema(dict(type='jenkins', path=1))
Ejemplo n.º 4
0
 def test_no_path(self):
     text = "'' does not exist for dictionary value @ data['path']"
     with ShouldFailSchemaWith(text):
         Plugin.schema(dict(type='jenkins', path=''))
Ejemplo n.º 5
0
 def test_invalid_name(self):
     text = "expected str for dictionary value @ data['name']"
     with ShouldFailSchemaWith(text):
         Plugin.schema(dict(type='jenkins', name=[]))
Ejemplo n.º 6
0
 def test_schema_extra_keys(self):
     with ShouldFailSchemaWith("extra keys not allowed @ data['foo']"):
         Plugin.schema(dict(type='jenkins', foo='bar'))
Ejemplo n.º 7
0
 def test_schema_wrong_type(self):
     text = "expected str for dictionary value @ data['path']"
     with ShouldFailSchemaWith(text):
         Plugin.schema(dict(type='bar', path=['/']))