]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
add tests for the grep utilities in remotes
authorAlfredo Deza <alfredo.deza@inktank.com>
Tue, 23 Sep 2014 16:56:17 +0000 (12:56 -0400)
committerAlfredo Deza <alfredo.deza@inktank.com>
Tue, 23 Sep 2014 16:56:23 +0000 (12:56 -0400)
Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
ceph_deploy/tests/unit/hosts/test_remotes.py [new file with mode: 0644]

diff --git a/ceph_deploy/tests/unit/hosts/test_remotes.py b/ceph_deploy/tests/unit/hosts/test_remotes.py
new file mode 100644 (file)
index 0000000..ca428d0
--- /dev/null
@@ -0,0 +1,16 @@
+from cStringIO import StringIO
+
+from ceph_deploy.hosts import remotes
+
+
+class TestObjectGrep(object):
+
+    def setup(self):
+        self.file_object = StringIO('foo\n')
+        self.file_object.seek(0)
+
+    def test_finds_term(self):
+        assert remotes.object_grep('foo', self.file_object)
+
+    def test_does_not_find_anything(self):
+        assert remotes.object_grep('bar', self.file_object) is False