From e6e354c4839619f38c4db77fca844921e61e44eb Mon Sep 17 00:00:00 2001 From: gholt Date: Thu, 7 Oct 2010 08:23:17 -0700 Subject: [PATCH] Added some missing test stubs so we can better see coverage (and get a little syntax-level "testing"). --- test/unit/account/test_replicator.py | 32 ++++++++++++++++++++++++++ test/unit/common/test_bench.py | 29 +++++++++++++++++++++++ test/unit/common/test_daemon.py | 29 +++++++++++++++++++++++ test/unit/common/test_direct_client.py | 5 +++- test/unit/common/test_exceptions.py | 3 ++- test/unit/container/test_replicator.py | 32 ++++++++++++++++++++++++++ 6 files changed, 128 insertions(+), 2 deletions(-) create mode 100644 test/unit/account/test_replicator.py create mode 100644 test/unit/common/test_bench.py create mode 100644 test/unit/common/test_daemon.py create mode 100644 test/unit/container/test_replicator.py diff --git a/test/unit/account/test_replicator.py b/test/unit/account/test_replicator.py new file mode 100644 index 0000000000..6b3d045eaa --- /dev/null +++ b/test/unit/account/test_replicator.py @@ -0,0 +1,32 @@ +# Copyright (c) 2010 OpenStack, LLC. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import unittest +from swift.account import replicator + + +class TestReplicator(unittest.TestCase): + """ + swift.account.replicator is currently just a subclass with some class + variables overridden, but at least this test stub will ensure proper Python + syntax. + """ + + def test_placeholder(self): + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/common/test_bench.py b/test/unit/common/test_bench.py new file mode 100644 index 0000000000..7b75aba79e --- /dev/null +++ b/test/unit/common/test_bench.py @@ -0,0 +1,29 @@ +# Copyright (c) 2010 OpenStack, LLC. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# TODO: Tests + +import unittest +from swift.common import bench + + +class TestBench(unittest.TestCase): + + def test_placeholder(self): + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/common/test_daemon.py b/test/unit/common/test_daemon.py new file mode 100644 index 0000000000..e2db43caa6 --- /dev/null +++ b/test/unit/common/test_daemon.py @@ -0,0 +1,29 @@ +# Copyright (c) 2010 OpenStack, LLC. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# TODO: Tests + +import unittest +from swift.common import daemon + + +class TestDaemon(unittest.TestCase): + + def test_placeholder(self): + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/common/test_direct_client.py b/test/unit/common/test_direct_client.py index a925c118bb..35ed07ffd7 100644 --- a/test/unit/common/test_direct_client.py +++ b/test/unit/common/test_direct_client.py @@ -17,7 +17,10 @@ import unittest -class TestAuditor(unittest.TestCase): +from swift.common import direct_client + + +class TestDirectClient(unittest.TestCase): def test_placeholder(self): pass diff --git a/test/unit/common/test_exceptions.py b/test/unit/common/test_exceptions.py index bfb251b139..35a5801e77 100644 --- a/test/unit/common/test_exceptions.py +++ b/test/unit/common/test_exceptions.py @@ -18,7 +18,8 @@ import unittest from swift.common import exceptions -class TestAuditor(unittest.TestCase): + +class TestExceptions(unittest.TestCase): def test_placeholder(self): pass diff --git a/test/unit/container/test_replicator.py b/test/unit/container/test_replicator.py new file mode 100644 index 0000000000..8f7a032893 --- /dev/null +++ b/test/unit/container/test_replicator.py @@ -0,0 +1,32 @@ +# Copyright (c) 2010 OpenStack, LLC. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import unittest +from swift.container import replicator + + +class TestReplicator(unittest.TestCase): + """ + swift.container.replicator is currently just a subclass with some class + variables overridden, but at least this test stub will ensure proper Python + syntax. + """ + + def test_placeholder(self): + pass + + +if __name__ == '__main__': + unittest.main()