Example #1
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)
Example #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)
Example #3
0
 def test_action(self):
     action = InitAction(default_args())
     action._config = Mock()
     action._needs_write = Mock(return_value=True)
     action.action()
Example #4
0
 def test_action(self):
     action = InitAction(default_args())
     action._config = Mock()
     action._needs_write = Mock(return_value=True)
     action.action()
Example #5
0
 def test_action(self):
     with patch('lamvery.actions.init.confirm_overwrite') as c:
         c.return_value = True
         action = InitAction(default_args())
         action._config = Mock()
         action.action()