예제 #1
0
    def test_tenant(self):
        """Test tenant input validation."""
        api = tenant.API()

        good = {'systems': [1234, 2345]}
        _ok(api.create, 'aaa', good)
        _ok(api.create, 'www_', good)
        # is reserved.
        _fail(api.create, 'www-s', good)
        _ok(api.create, 'aaa:bbb', good)
        _fail(api.create, 'aaa::bbb', good)
        _fail(api.create, 'aaa:bbb:', good)
        _fail(api.create, 'aaa:bbb', _patch(good, '/systems/0', 'a'))
예제 #2
0
 def setUp(self):
     self.tnt = tenant.API()