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))
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) ))
def test_path_not_string(self): text = "expected str for dictionary value @ data['path']" with ShouldFailSchemaWith(text): Plugin.schema(dict(type='jenkins', path=1))
def test_no_path(self): text = "'' does not exist for dictionary value @ data['path']" with ShouldFailSchemaWith(text): Plugin.schema(dict(type='jenkins', path=''))
def test_invalid_name(self): text = "expected str for dictionary value @ data['name']" with ShouldFailSchemaWith(text): Plugin.schema(dict(type='jenkins', name=[]))
def test_schema_extra_keys(self): with ShouldFailSchemaWith("extra keys not allowed @ data['foo']"): Plugin.schema(dict(type='jenkins', foo='bar'))
def test_schema_wrong_type(self): text = "expected str for dictionary value @ data['path']" with ShouldFailSchemaWith(text): Plugin.schema(dict(type='bar', path=['/']))