예제 #1
0
파일: init_test.py 프로젝트: ijin/lamvery
    def test_needs_write_conf(self):
        # New
        args = default_args()
        action = InitAction(args)
        eq_(action._needs_write('bar'), True)
        # Overwrite
        action = InitAction(default_args())

        with patch('sys.stdin') as r:
            # Overwrite yes
            r.readline = Mock(return_value='y')
            eq_(action._needs_write('.lamvery.yml'), True)
            # Overwrite no
            r.readline = Mock(return_value='n')
            eq_(action._needs_write('.lamvery.yml'), False)
예제 #2
0
    def test_needs_write_conf(self):
        # New
        args = default_args()
        action = InitAction(args)
        eq_(action._needs_write('bar'), True)
        # Overwrite
        action = InitAction(default_args())

        with patch('sys.stdin') as r:
            # Overwrite yes
            r.readline = Mock(return_value='y')
            eq_(action._needs_write('.lamvery.yml'), True)
            # Overwrite no
            r.readline = Mock(return_value='n')
            eq_(action._needs_write('.lamvery.yml'), False)
예제 #3
0
파일: init_test.py 프로젝트: ijin/lamvery
 def test_action(self):
     action = InitAction(default_args())
     action._config = Mock()
     action._needs_write = Mock(return_value=True)
     action.action()
예제 #4
0
 def test_action(self):
     action = InitAction(default_args())
     action._config = Mock()
     action._needs_write = Mock(return_value=True)
     action.action()