示例#1
0
 def test_json_serializable(self, mock_add):
     """
     ensure the arguments are json serializable
     see https://pulp.plan.io/issues/2012
     """
     url = 'file://%s/' % self.tmp_dir
     conduit = CatalogerConduit(SOURCE_ID, EXPIRES)
     cataloger = YumCataloger()
     cataloger.refresh(conduit, {}, url)
     for call in mock_add.call_args_list:
         json.dumps(call)
示例#2
0
文件: test_yum.py 项目: ulif/pulp_rpm
 def test_json_serializable(self, mock_add):
     """
     ensure the arguments are json serializable
     see https://pulp.plan.io/issues/2012
     """
     url = 'file://%s/' % self.tmp_dir
     conduit = CatalogerConduit(SOURCE_ID, EXPIRES)
     cataloger = YumCataloger()
     cataloger.refresh(conduit, {}, url)
     for call in mock_add.call_args_list:
         json.dumps(call)
示例#3
0
 def test_refresh(self, mock_add):
     url = 'file://%s/' % self.tmp_dir
     conduit = CatalogerConduit(SOURCE_ID, EXPIRES)
     cataloger = YumCataloger()
     cataloger.refresh(conduit, {}, url)
     with open(JSON_PATH) as fp:
         expected = json.load(fp)
     self.assertEqual(mock_add.call_count, len(expected))
     for entry in expected:
         self.assertTrue(
             mock_add.called_with(SOURCE_ID, EXPIRES, entry['type_id'],
                                  entry['unit_key'],
                                  self._normalized(entry['url'])))
示例#4
0
 def test_refresh(self, mock_add):
     url = 'file://%s/' % self.tmp_dir
     conduit = CatalogerConduit(SOURCE_ID, EXPIRES)
     cataloger = YumCataloger()
     cataloger.refresh(conduit, {}, url)
     with open(JSON_PATH) as fp:
         expected = json.load(fp)
     self.assertEqual(mock_add.call_count, len(expected))
     for entry in expected:
         self.assertTrue(
             mock_add.called_with(
                 SOURCE_ID,
                 EXPIRES,
                 entry['type_id'],
                 entry['unit_key'],
                 self._normalized(entry['url'])))