Enable py27 and py35 unit testing
This also includes a couple of basic unit tests as proof that this is working. Change-Id: Iff8241b4bdfd3c97319198873527911e8ed318e1
This commit is contained in:
parent
5193d0010e
commit
e08b086914
|
@ -0,0 +1,3 @@
|
||||||
|
[DEFAULT]
|
||||||
|
test_path=./oslogmerger/tests/unit/
|
||||||
|
top_dir=./
|
|
@ -16,6 +16,10 @@
|
||||||
check:
|
check:
|
||||||
jobs:
|
jobs:
|
||||||
- tox-pep8
|
- tox-pep8
|
||||||
|
- tox-py35
|
||||||
|
- tox-py27
|
||||||
gate:
|
gate:
|
||||||
jobs:
|
jobs:
|
||||||
- tox-pep8
|
- tox-pep8
|
||||||
|
- tox-py35
|
||||||
|
- tox-py27
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
import mock
|
||||||
|
from oslotest import base
|
||||||
|
|
||||||
|
|
||||||
|
class BaseTestCase(base.BaseTestCase):
|
||||||
|
def setUp(self):
|
||||||
|
super(BaseTestCase, self).setUp()
|
||||||
|
self.addCleanup(mock.patch.stopall)
|
|
@ -0,0 +1,18 @@
|
||||||
|
from oslogmerger import oslogmerger as om
|
||||||
|
from oslogmerger.tests import base
|
||||||
|
|
||||||
|
|
||||||
|
class PathManipulationTests(base.BaseTestCase):
|
||||||
|
def test_get_path_and_alias(self):
|
||||||
|
self.assertEqual(
|
||||||
|
om.get_path_and_alias('filename', '/base/', '.log'),
|
||||||
|
('/base/filename.log', None, False))
|
||||||
|
|
||||||
|
self.assertEqual(
|
||||||
|
om.get_path_and_alias('filename:alias', '/base/', '.log'),
|
||||||
|
('/base/filename.log', 'alias', False))
|
||||||
|
|
||||||
|
def test_get_path_and_alias_http(self):
|
||||||
|
self.assertEqual(
|
||||||
|
om.get_path_and_alias('http://server/filename.log', '', ''),
|
||||||
|
('http://server/filename.log', None, True))
|
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# preserve old behavior of using an arg as a regex when '--' is not present
|
||||||
|
case $@ in
|
||||||
|
(*--*) ostestr $@;;
|
||||||
|
('') ostestr;;
|
||||||
|
(*) ostestr --regex "$@"
|
||||||
|
esac
|
Loading…
Reference in New Issue