Пример #1
0
 def setUp(self):
     self.proj = common.activate_project({
         'main': ['basic'],
     })
     state = State()
     state.create(1)
     self.task_state = state.get_task_state(1)
Пример #2
0
class CrossTests(unittest.TestCase):
    def setUp(self):
        self.state = State()
        self.task_id = 1
        self.state.create(self.task_id)
        self.task_state = self.state.get_task_state(self.task_id)
        self.proj = common.activate(['main', 'cross'])

    def tearDown(self):
        common.deactivate()

    def test_cross_normalize_arguments(self):
        normalize_arguments(
            self.proj,
            self.task_state,
            'basic/bar.py',
            163)

    def test_cross_remove_argument(self):
        remove_argument(
            self.proj,
            self.task_state,
            1,
            'basic/bar.py',
            163)
Пример #3
0
class CrossTests(unittest.TestCase):
    def setUp(self):
        self.state = State()
        self.task_id = 1
        self.state.create(self.task_id)
        self.task_state = self.state.get_task_state(self.task_id)
        self.proj = common.activate_project({
            'main': ['basic'],
            'cross': ['use_bar'],
        })

    def tearDown(self):
        common.deactivate()

    def test_cross_normalize_arguments(self):
        normalize_arguments(
            self.proj,
            self.task_state,
            'basic/bar.py',
            163)

        common.compare_projects(
            'cross_basic_normalize_arguments',
            'main',
            'basic')

        common.compare_projects(
            'cross_use_bar_normalize_arguments',
            'cross',
            'use_bar')

    def test_cross_remove_argument(self):
        remove_argument(
            self.proj,
            self.task_state,
            1,
            'basic/bar.py',
            163)

        common.compare_projects(
            'cross_basic_remove_argument',
            'main',
            'basic')

        common.compare_projects(
            'cross_use_bar_remove_argument',
            'cross',
            'use_bar')
Пример #4
0
 def setUp(self):
     self.state = State()
     self.task_id = 1
     self.state.create(self.task_id)
     self.task_state = self.state.get_task_state(self.task_id)
     self.proj = common.activate_project({
         'main': ['basic'],
         'cross': ['use_bar'],
     })
Пример #5
0
    def withFixture(self):
        with common.use_project({'main': ['basic'],
                                 'cross': ['use_bar']}) as self.proj,\
            common.use_proxy(State.start().proxy()) as self.state:

            self.task_id = 1
            self.state.create(self.task_id).get()
            self.task_state = self.state.get_task_state(self.task_id).get()

            yield
Пример #6
0
    def withFixture(self):
        with common.use_project({'main': ['basic'],
                                 'cross': ['use_bar']}) as self.proj,\
            common.use_proxy(State.start().proxy()) as self.state:

            self.task_id = 1
            self.state.create(self.task_id).get()
            self.task_state = self.state.get_task_state(self.task_id).get()

            yield
Пример #7
0
class Tests(unittest.TestCase):
    def setUp(self):
        self.proj = common.activate_project({'main': ['basic']})
        self.state = State()
        self.state.create(1)
        self.task_state = self.state.get_task_state(1)

    def tearDown(self):
        common.deactivate()

    def test_simple(self):
        rename(self.proj,
               self.task_state,
               'Llama',
               'basic/foo.py',
               8)

        common.compare_projects(
            'basic_rename_llama',
            'main',
            'basic')
Пример #8
0
 def withFixture(self):
     with common.use_project({'main': ['basic']}) as self.proj,\
          common.use_proxy(State.start().proxy()) as self.state:
         self.state.create(1).get()
         self.task_state = TaskState(self.state, 1)
         yield
Пример #9
0
def state():
    state = State.start().proxy()
    try:
        yield state
    finally:
        state.stop()
Пример #10
0
 def setUp(self):
     self.state = State()
     self.task_id = 1
     self.state.create(self.task_id)
     self.task_state = self.state.get_task_state(self.task_id)
     self.proj = common.activate(['main', 'cross'])
Пример #11
0
 def test_simple(self):
     state = State()
     state.create(1)
     task_state = state.get_task_state(1)
     rename(self.proj, task_state, 'Llama', 'basic/foo.py', 8)
Пример #12
0
 def withFixture(self):
     with common.use_project({'main': ['basic']}) as self.proj,\
          common.use_proxy(State.start().proxy()) as self.state:
         self.state.create(1).get()
         self.task_state = TaskState(self.state, 1)
         yield
Пример #13
0
 def setUp(self):
     self.proj = common.activate(['main'])
     state = State()
     state.create(1)
     self.task_state = state.get_task_state(1)
Пример #14
0
def state():
    state = State.start().proxy()
    try:
        yield state
    finally:
        state.stop()