예제 #1
0
파일: test_state.py 프로젝트: jackqu7/Facio
    def test_get_context_variables(self):
        state = State()

        state.update_context_variables({'PROJECT_NAME': 'foo'})

        self.assertEqual(state.get_context_variables(), {
            'PROJECT_NAME': 'foo'})
예제 #2
0
파일: test_state.py 프로젝트: jackqu7/Facio
    def test_get_context_variable(self):
        state = State()

        state.update_context_variables({'PROJECT_NAME': 'foo'})

        self.assertEqual(state.get_context_variable('PROJECT_NAME'), 'foo')
        self.assertNotEqual(state.get_context_variable('not_created'), 'foo')
예제 #3
0
    def test_update_context_variables(self):
        state = State()

        state.update_context_variables([1, 2, 3])

        self.mocked_facio_state_State_warning.assert_called_once_with(
            'Failed to update context variables with [1, 2, 3]')
예제 #4
0
파일: test_state.py 프로젝트: jackqu7/Facio
    def test_update_context_variables(self):
        state = State()

        state.update_context_variables([1, 2, 3])

        self.mocked_facio_state_State_warning.assert_called_once_with(
            'Failed to update context variables with [1, 2, 3]')
예제 #5
0
    def test_get_context_variables(self):
        state = State()

        state.update_context_variables({'PROJECT_NAME': 'foo'})

        self.assertEqual(state.get_context_variables(),
                         {'PROJECT_NAME': 'foo'})
예제 #6
0
파일: test_state.py 프로젝트: jackqu7/Facio
    def test_save_hook_call(self):
        state = State()

        state.save_hook_call('foo.bar', 'baz')
        state.save_hook_call('baz.foo', 'bar')
        calls = state.save_hook_call('foo.bar', 'baz')

        self.assertEqual(calls, [('foo.bar', 'baz'), ('baz.foo', 'bar')])
예제 #7
0
    def test_save_hook_call(self):
        state = State()

        state.save_hook_call('foo.bar', 'baz')
        state.save_hook_call('baz.foo', 'bar')
        calls = state.save_hook_call('foo.bar', 'baz')

        self.assertEqual(calls, [('foo.bar', 'baz'), ('baz.foo', 'bar')])
예제 #8
0
파일: test_state.py 프로젝트: jackqu7/Facio
    def test_get_hook_call(self):
        state = State()

        state.save_hook_call('foo.bar', 'baz')
        state.save_hook_call('baz.foo', 'bar')

        self.assertEqual(state.get_hook_call('foo.bar'), 'baz')
        self.assertEqual(state.get_hook_call('baz.foo'), 'bar')
예제 #9
0
    def test_get_hook_call(self):
        state = State()

        state.save_hook_call('foo.bar', 'baz')
        state.save_hook_call('baz.foo', 'bar')

        self.assertEqual(state.get_hook_call('foo.bar'), 'baz')
        self.assertEqual(state.get_hook_call('baz.foo'), 'bar')
예제 #10
0
    def test_get_context_variable(self):
        state = State()

        state.update_context_variables({'PROJECT_NAME': 'foo'})

        self.assertEqual(state.get_context_variable('PROJECT_NAME'), 'foo')
        self.assertNotEqual(state.get_context_variable('not_created'), 'foo')
예제 #11
0
    def test_get_context_variables_empty(self):
        state = State()

        self.assertEqual(state.get_context_variables(), {})
예제 #12
0
파일: test_state.py 프로젝트: jackqu7/Facio
    def test_return_project_root(self, mock_pwd):
        state = State()
        state.set_project_name('foo')

        self.assertEqual(state.get_project_root(), '/bar/foo')
예제 #13
0
파일: test_state.py 프로젝트: jackqu7/Facio
    def test_get_context_variables_empty(self):
        state = State()

        self.assertEqual(state.get_context_variables(), {})
예제 #14
0
    def test_return_project_root(self, mock_pwd):
        state = State()
        state.set_project_name('foo')

        self.assertEqual(state.get_project_root(), '/bar/foo')
예제 #15
0
    def test_return_current_working_dir(self, mock_pwd):
        state = State()
        state.set_project_name('foo')

        self.assertEqual(state.get_working_directory(), '/foo')
예제 #16
0
    def test_get_set_project_name(self):
        state = State()
        state.set_project_name('foo')

        self.assertEqual(state.get_project_name(), 'foo')
예제 #17
0
파일: test_state.py 프로젝트: jackqu7/Facio
    def test_return_current_working_dir(self, mock_pwd):
        state = State()
        state.set_project_name('foo')

        self.assertEqual(state.get_working_directory(), '/foo')
예제 #18
0
    def test_same_instance_always_returned(self):
        s1 = State()
        s2 = State()

        self.assertEqual(s1.state, s2.state)
예제 #19
0
파일: test_state.py 프로젝트: jackqu7/Facio
    def test_get_set_project_name(self):
        state = State()
        state.set_project_name('foo')

        self.assertEqual(state.get_project_name(), 'foo')