Selaa lähdekoodia

AMBARI-3274. Add ambari client unit test to the main mvn test target so that the unit tests are always run as part of the build. (Andrew Onischuk via mahadev)

Mahadev Konar 12 vuotta sitten
vanhempi
commit
ab10b73e8c

+ 1 - 1
ambari-client/pom.xml

@@ -27,7 +27,7 @@
   <artifactId>ambari-client</artifactId>
   <packaging>pom</packaging>
   <version>1.3.0-SNAPSHOT</version>
-  <name>Ambari client</name>
+  <name>Ambari Client</name>
   <description>Ambari Python client</description>
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

+ 6 - 1
ambari-client/src/main/python/ambari_client/core/http_client.py

@@ -18,7 +18,12 @@
 import logging
 import posixpath
 import sys
-import pycurl
+try:
+  import pycurl
+# pycurl is not necessary for testcases, mock it
+except ImportError:
+  from mock.mock import MagicMock
+  pycurl = MagicMock() 
 import cStringIO
 import StringIO
 import pdb

+ 1 - 0
pom.xml

@@ -52,6 +52,7 @@
     <module>ambari-project</module>
     <module>ambari-server</module>
     <module>ambari-agent</module>
+    <module>ambari-client</module>
   </modules>
   <build>
     <pluginManagement>