X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Ftest%2Fpybind%2Ftest_ceph_daemon.py;fp=src%2Fceph%2Fsrc%2Ftest%2Fpybind%2Ftest_ceph_daemon.py;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=64a0ea39fe6882e76835ba8d6c58265fb83ad789;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/test/pybind/test_ceph_daemon.py b/src/ceph/src/test/pybind/test_ceph_daemon.py deleted file mode 100755 index 64a0ea3..0000000 --- a/src/ceph/src/test/pybind/test_ceph_daemon.py +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env nosetests -# -*- mode:python; tab-width:4; indent-tabs-mode:t -*- -# vim: ts=4 sw=4 smarttab expandtab -# -""" -Copyright (C) 2015 Red Hat - -This is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public -License version 2, as published by the Free Software -Foundation. See file COPYING. -""" - -from unittest import TestCase - -from ceph_daemon import DaemonWatcher - -try: - from StringIO import StringIO -except ImportError: - from io import StringIO - - -class TestDaemonWatcher(TestCase): - def test_format(self): - dw = DaemonWatcher(None) - - self.assertEqual(dw.format_dimless(1, 4), " 1 ") - self.assertEqual(dw.format_dimless(1000, 4), "1.0k") - self.assertEqual(dw.format_dimless(3.14159, 4), " 3 ") - self.assertEqual(dw.format_dimless(1400000, 4), "1.4M") - - def test_col_width(self): - dw = DaemonWatcher(None) - - self.assertEqual(dw.col_width("foo"), 4) - self.assertEqual(dw.col_width("foobar"), 6) - - def test_supports_color(self): - dw = DaemonWatcher(None) - # Can't count on having a tty available during tests, so only test the false case - self.assertEqual(dw.supports_color(StringIO()), False) -# Local Variables: -# compile-command: "cd ../.. ; make -j4 && -# PYTHONPATH=pybind nosetests --stop \ -# test/pybind/test_ceph_daemon.py -# End: