Skip to content
Snippets Groups Projects

Unit tests

Merged Maeva Pourpoint requested to merge unit_tests into master
Files
3
+ 10
11
@@ -6,19 +6,18 @@
import unittest
import sys
try:
import bline
except ImportError:
pass
from unittest.mock import patch
class TestBline(unittest.TestCase):
"""Tests for `bline` package."""
def setUp(self):
"""Set up test fixtures, if any."""
def tearDown(self):
"""Tear down test fixtures, if any."""
def test_import(self):
self.assertTrue('bline' in sys.modules, "Bline import failed!")
"""Test bline import"""
with patch.object(sys, 'argv', ['bline']):
with self.assertRaises(SystemExit):
try:
import bline.bline as bp
self.assertTrue(bp.PROG_NAME, 'BLINE')
except ImportError:
self.fail('Failed to import bline!')
Loading