예제 #1
0
 def test_get_username_fail(self, mock_stdin):
     assert manage._get_username() == 'jen'
예제 #2
0
 def test_get_username_success(self, mock_stdin):
     assert manage._get_username() == 'jen'
예제 #3
0
 def test_get_username(self, mock_get_usernam):
     assert manage._get_username() == 'foo-bar-baz'
예제 #4
0
def test_get_username_fail():
    bad_username = '******' * (Journalist.MIN_USERNAME_LEN - 1)
    with mock.patch("manage.obtain_input", side_effect=[bad_username, 'jen']):
        assert manage._get_username() == 'jen'
예제 #5
0
def test_get_username_success():
    with mock.patch("manage.obtain_input", return_value='jen'):
        assert manage._get_username() == 'jen'
예제 #6
0
def test_get_username(mocker):
    mocker.patch("manage.obtain_input", return_value='foo-bar-baz')
    assert manage._get_username() == 'foo-bar-baz'