blob: 11b1a2259f7db58e3fd977ae7a6d1e7d47a065e3 [file] [log] [blame]
Joshua Hesketh66f9f602013-08-14 11:28:10 +10001#!/usr/bin/python2
2#
3# Copyright 2013 Rackspace Australia
4#
5# Licensed under the Apache License, Version 2.0 (the "License"); you may
6# not use this file except in compliance with the License. You may obtain
7# a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14# License for the specific language governing permissions and limitations
15# under the License.
Joshua Heskethef72b8a2013-08-12 11:17:14 +100016
Joshua Heskethef72b8a2013-08-12 11:17:14 +100017
Joshua Hesketh66f9f602013-08-14 11:28:10 +100018import json
19import os
20import testtools
21from fakes import FakeGearmanManager, FakeGearmanServer
Joshua Heskethef72b8a2013-08-12 11:17:14 +100022
Joshua Hesketh66f9f602013-08-14 11:28:10 +100023CONFIG_DIR = os.path.join(os.path.dirname(__file__), 'etc')
24with open(os.path.join(CONFIG_DIR, 'config.json'), 'r') as config_stream:
25 CONFIG = json.load(config_stream)
Joshua Heskethef72b8a2013-08-12 11:17:14 +100026
Joshua Heskethef72b8a2013-08-12 11:17:14 +100027
Joshua Hesketh66f9f602013-08-14 11:28:10 +100028class TestGearmanManager(testtools.TestCase):
29 def setUp(self):
30 super(TestGearmanManager, self).setUp()
31 self.config = CONFIG
32 self.tasks = []
33 self.gearman_server = FakeGearmanServer(
34 self.config['zuul_server']['gearman_port'])
35
36 self.gearman_manager = FakeGearmanManager(self.config,
37 self.tasks,
38 self)
39
40 def test_manager_function_registered(self):
41 """ Check the manager is set up correctly and registered with the
42 gearman server with an appropriate function """
43 pass
Joshua Heskethef72b8a2013-08-12 11:17:14 +100044
45if __name__ == '__main__':
46 unittest.main()