def test_settings_exists(self, is_dir, ls, nz, bl): is_dir.return_value = True ls.side_effect = [[ commandline.USERLAND_HERE / 'opalapp', commandline.USERLAND_HERE / 'notanapp' ]] # We need both of these to make sure our tests run properly on Pythons 2&3 nz.return_value = True bl.return_value = True name = commandline.find_application_name() self.assertEqual('opalapp', name)
def test_settings_exists(self, is_dir, ls, nz, bl): is_dir.return_value = True ls.side_effect = [ [ commandline.USERLAND_HERE/'opalapp', commandline.USERLAND_HERE/'notanapp' ] ] # We need both of these to make sure our tests run properly on Pythons 2&3 nz.return_value = True bl.return_value = True name = commandline.find_application_name() self.assertEqual('opalapp', name)
def test_not_found(self): with patch.object(commandline.sys, 'exit') as exiter: commandline.find_application_name() exiter.assert_called_with(1)
def test_not_found(self): with patch.object(commandline.sys, 'exit') as exiter: commandline.find_application_name() exiter.assert_called_with(1)