Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 3
0
 def test_action(self):
     action = InitAction(default_args())
     action._config = Mock()
     action._needs_write = Mock(return_value=True)
     action.action()
Exemplo n.º 4
0
 def test_action(self):
     action = InitAction(default_args())
     action._config = Mock()
     action._needs_write = Mock(return_value=True)
     action.action()