You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ds...@apache.org on 2013/12/18 14:38:39 UTC

git commit: AMBARI-4104 TestHardware.test_fqdnDomainHostname() fails (dsen)

Updated Branches:
  refs/heads/trunk 4aec796a1 -> 9379a8851


AMBARI-4104 TestHardware.test_fqdnDomainHostname() fails (dsen)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9379a885
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9379a885
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9379a885

Branch: refs/heads/trunk
Commit: 9379a8851689f617c109d085b9637183cfa35494
Parents: 4aec796
Author: Dmitry Sen <ds...@hortonworks.com>
Authored: Wed Dec 18 15:38:27 2013 +0200
Committer: Dmitry Sen <ds...@hortonworks.com>
Committed: Wed Dec 18 15:38:27 2013 +0200

----------------------------------------------------------------------
 ambari-agent/src/test/python/ambari_agent/TestHardware.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9379a885/ambari-agent/src/test/python/ambari_agent/TestHardware.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/ambari_agent/TestHardware.py b/ambari-agent/src/test/python/ambari_agent/TestHardware.py
index e4937ec..ef8977c 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestHardware.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestHardware.py
@@ -19,6 +19,7 @@ limitations under the License.
 '''
 
 from unittest import TestCase
+from ambari_agent import hostname
 from ambari_agent.Hardware import Hardware
 from mock.mock import patch
 from ambari_agent.Facter import Facter
@@ -75,9 +76,11 @@ class TestHardware(TestCase):
 
     self.assertEquals(result, None)
 
+  @patch.object(hostname,"hostname")
   @patch.object(Facter, "getFqdn")
-  def test_fqdnDomainHostname(self, facter_getFqdn_mock):
+  def test_fqdnDomainHostname(self, facter_getFqdn_mock, hostname_mock):
     facter_getFqdn_mock.return_value = "ambari.apache.org"
+    hostname_mock.return_value = 'ambari'
     result = Facter().facterInfo()
 
     self.assertEquals(result['hostname'], "ambari")