]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rename test to tests, follows best practices for tests dirs
authorAlfredo Deza <adeza@redhat.com>
Wed, 11 Feb 2015 16:25:45 +0000 (11:25 -0500)
committerYehuda Sadeh <yehuda@redhat.com>
Mon, 2 Mar 2015 19:20:35 +0000 (11:20 -0800)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
(cherry picked from commit 7b2062602f7d3de206f4660c3e2847f86ac41e24)

tasks/test/__init__.py [deleted file]
tasks/test/test_devstack.py [deleted file]
tasks/test/test_radosgw_admin.py [deleted file]
tasks/tests/__init__.py [new file with mode: 0644]
tasks/tests/test_devstack.py [new file with mode: 0644]
tasks/tests/test_radosgw_admin.py [new file with mode: 0644]

diff --git a/tasks/test/__init__.py b/tasks/test/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/tasks/test/test_devstack.py b/tasks/test/test_devstack.py
deleted file mode 100644 (file)
index 117b307..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-from textwrap import dedent
-
-from .. import devstack
-
-
-class TestDevstack(object):
-    def test_parse_os_table(self):
-        table_str = dedent("""
-            +---------------------+--------------------------------------+
-            |       Property      |                Value                 |
-            +---------------------+--------------------------------------+
-            |     attachments     |                  []                  |
-            |  availability_zone  |                 nova                 |
-            |       bootable      |                false                 |
-            |      created_at     |      2014-02-21T17:14:47.548361      |
-            | display_description |                 None                 |
-            |     display_name    |                 NAME                 |
-            |          id         | ffdbd1bb-60dc-4d95-acfe-88774c09ad3e |
-            |       metadata      |                  {}                  |
-            |         size        |                  1                   |
-            |     snapshot_id     |                 None                 |
-            |     source_volid    |                 None                 |
-            |        status       |               creating               |
-            |     volume_type     |                 None                 |
-            +---------------------+--------------------------------------+
-            """).strip()
-        expected = {
-            'Property': 'Value',
-            'attachments': '[]',
-            'availability_zone': 'nova',
-            'bootable': 'false',
-            'created_at': '2014-02-21T17:14:47.548361',
-            'display_description': 'None',
-            'display_name': 'NAME',
-            'id': 'ffdbd1bb-60dc-4d95-acfe-88774c09ad3e',
-            'metadata': '{}',
-            'size': '1',
-            'snapshot_id': 'None',
-            'source_volid': 'None',
-            'status': 'creating',
-            'volume_type': 'None'}
-
-        vol_info = devstack.parse_os_table(table_str)
-        assert vol_info == expected
-
-
-
-
diff --git a/tasks/test/test_radosgw_admin.py b/tasks/test/test_radosgw_admin.py
deleted file mode 100644 (file)
index 59f3578..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-from mock import Mock
-
-from .. import radosgw_admin
-
-acl_with_version = """<?xml version="1.0" encoding="UTF-8"?><AccessControlPolicy xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Owner><ID>foo</ID><DisplayName>Foo</DisplayName></Owner><AccessControlList><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser"><ID>foo</ID><DisplayName>Foo</DisplayName></Grantee><Permission>FULL_CONTROL</Permission></Grant></AccessControlList></AccessControlPolicy>
-"""  # noqa
-
-
-acl_without_version = """<AccessControlPolicy xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Owner><ID>foo</ID><DisplayName>Foo</DisplayName></Owner><AccessControlList><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser"><ID>foo</ID><DisplayName>Foo</DisplayName></Grantee><Permission>FULL_CONTROL</Permission></Grant></AccessControlList></AccessControlPolicy>
-"""  # noqa
-
-
-class TestGetAcl(object):
-
-    def setup(self):
-        self.key = Mock()
-
-    def test_removes_xml_version(self):
-        self.key.get_xml_acl = Mock(return_value=acl_with_version)
-        result = radosgw_admin.get_acl(self.key)
-        assert result.startswith('<AccessControlPolicy')
-
-    def test_xml_version_is_already_removed(self):
-        self.key.get_xml_acl = Mock(return_value=acl_without_version)
-        result = radosgw_admin.get_acl(self.key)
-        assert result.startswith('<AccessControlPolicy')
-
-    def test_newline_gets_trimmed(self):
-        self.key.get_xml_acl = Mock(return_value=acl_without_version)
-        result = radosgw_admin.get_acl(self.key)
-        assert result.endswith('\n') is False
diff --git a/tasks/tests/__init__.py b/tasks/tests/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tasks/tests/test_devstack.py b/tasks/tests/test_devstack.py
new file mode 100644 (file)
index 0000000..117b307
--- /dev/null
@@ -0,0 +1,48 @@
+from textwrap import dedent
+
+from .. import devstack
+
+
+class TestDevstack(object):
+    def test_parse_os_table(self):
+        table_str = dedent("""
+            +---------------------+--------------------------------------+
+            |       Property      |                Value                 |
+            +---------------------+--------------------------------------+
+            |     attachments     |                  []                  |
+            |  availability_zone  |                 nova                 |
+            |       bootable      |                false                 |
+            |      created_at     |      2014-02-21T17:14:47.548361      |
+            | display_description |                 None                 |
+            |     display_name    |                 NAME                 |
+            |          id         | ffdbd1bb-60dc-4d95-acfe-88774c09ad3e |
+            |       metadata      |                  {}                  |
+            |         size        |                  1                   |
+            |     snapshot_id     |                 None                 |
+            |     source_volid    |                 None                 |
+            |        status       |               creating               |
+            |     volume_type     |                 None                 |
+            +---------------------+--------------------------------------+
+            """).strip()
+        expected = {
+            'Property': 'Value',
+            'attachments': '[]',
+            'availability_zone': 'nova',
+            'bootable': 'false',
+            'created_at': '2014-02-21T17:14:47.548361',
+            'display_description': 'None',
+            'display_name': 'NAME',
+            'id': 'ffdbd1bb-60dc-4d95-acfe-88774c09ad3e',
+            'metadata': '{}',
+            'size': '1',
+            'snapshot_id': 'None',
+            'source_volid': 'None',
+            'status': 'creating',
+            'volume_type': 'None'}
+
+        vol_info = devstack.parse_os_table(table_str)
+        assert vol_info == expected
+
+
+
+
diff --git a/tasks/tests/test_radosgw_admin.py b/tasks/tests/test_radosgw_admin.py
new file mode 100644 (file)
index 0000000..59f3578
--- /dev/null
@@ -0,0 +1,31 @@
+from mock import Mock
+
+from .. import radosgw_admin
+
+acl_with_version = """<?xml version="1.0" encoding="UTF-8"?><AccessControlPolicy xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Owner><ID>foo</ID><DisplayName>Foo</DisplayName></Owner><AccessControlList><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser"><ID>foo</ID><DisplayName>Foo</DisplayName></Grantee><Permission>FULL_CONTROL</Permission></Grant></AccessControlList></AccessControlPolicy>
+"""  # noqa
+
+
+acl_without_version = """<AccessControlPolicy xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Owner><ID>foo</ID><DisplayName>Foo</DisplayName></Owner><AccessControlList><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser"><ID>foo</ID><DisplayName>Foo</DisplayName></Grantee><Permission>FULL_CONTROL</Permission></Grant></AccessControlList></AccessControlPolicy>
+"""  # noqa
+
+
+class TestGetAcl(object):
+
+    def setup(self):
+        self.key = Mock()
+
+    def test_removes_xml_version(self):
+        self.key.get_xml_acl = Mock(return_value=acl_with_version)
+        result = radosgw_admin.get_acl(self.key)
+        assert result.startswith('<AccessControlPolicy')
+
+    def test_xml_version_is_already_removed(self):
+        self.key.get_xml_acl = Mock(return_value=acl_without_version)
+        result = radosgw_admin.get_acl(self.key)
+        assert result.startswith('<AccessControlPolicy')
+
+    def test_newline_gets_trimmed(self):
+        self.key.get_xml_acl = Mock(return_value=acl_without_version)
+        result = radosgw_admin.get_acl(self.key)
+        assert result.endswith('\n') is False