Mock get_auto_id function when run unit test 75/57675/1
authorfujinhua <fu.jinhua@zte.com.cn>
Thu, 26 Jul 2018 09:25:02 +0000 (17:25 +0800)
committerfujinhua <fu.jinhua@zte.com.cn>
Thu, 26 Jul 2018 09:25:02 +0000 (17:25 +0800)
Change-Id: I5737253287cd387bd1006c3de343dc18de35c21e
Issue-ID: VFC-986
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
lcm/settings.py

index aad4712..0c79a81 100644 (file)
@@ -182,3 +182,8 @@ if 'test' in sys.argv:
         TEST_OUTPUT_VERBOSE = True
         TEST_OUTPUT_DESCRIPTIONS = True
         TEST_OUTPUT_DIR = 'test-reports'
+
+    import mock
+    from lcm.pub.utils import idutil
+    idutil.get_auto_id = mock.Mock()
+    idutil.get_auto_id.return_value = 1