nncli

NextCloud Notes Command Line Interface
git clone git://git.danielmoch.com/nncli.git
Log | Files | Refs | LICENSE

commit 25acc2ba6fb177148aceecf157fbd7287428ac99
parent 5a0c0cb6303b0b58ca10146aa7868376ccdcfa52
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Sun,  2 Sep 2018 19:21:14 -0400

Get tests working. Ready for CI.

Diffstat:
M.coveragerc | 2+-
M.travis.yml | 8++++----
Mtests/test_config.py | 28++++------------------------
Mtests/test_nncli.py | 1+
4 files changed, 10 insertions(+), 29 deletions(-)

diff --git a/.coveragerc b/.coveragerc @@ -1,6 +1,6 @@ [run] branch = True -omit = hookmeup/__main__.py +omit = nncli/__main__.py [report] show_missing = True diff --git a/.travis.yml b/.travis.yml @@ -1,4 +1,4 @@ -# https://travis-ci.org/djmoch/hookmeup +# https://travis-ci.org/djmoch/nncli language: python matrix: @@ -35,9 +35,9 @@ jobs: script: make test <<: *xenial-mixin python: 3.7 - - stage: lint - script: make lint - python: 3.6 + # - stage: lint + # script: make lint + # python: 3.6 - stage: coverage script: make coverage after_success: coveralls diff --git a/tests/test_config.py b/tests/test_config.py @@ -1,33 +1,13 @@ -# -# The MIT License (MIT) -# -# Copyright (c) 2018 Daniel Moch -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# +# -*- encoding: utf-8 -*- + import os import sys from nncli.config import Config from pytest import raises -def test_init(): +def test_init(mocker): + mocker.patch('subprocess.check_output') config = Config() if sys.platform == 'linux': diff --git a/tests/test_nncli.py b/tests/test_nncli.py @@ -14,6 +14,7 @@ def mock_nncli(mocker): mocker.patch('nncli.nncli.NotesDB') mocker.patch('os.mkdir') mocker.patch.object(RotatingFileHandler, '_open') + mocker.patch('subprocess.check_output') def mock_get_config(mocker, return_list): mocker.patch.object(