예제 #1
0
    def test_add_identifiers(self, mock_add):
        testWork = Work()
        testWork.tmp_identifiers = ['id1']
        mock_val = MagicMock()
        mock_val.value = 'testID'
        mock_add.return_value = mock_val

        testWork.addIdentifiers()
        self.assertEqual(list(testWork.identifiers)[0].value, 'testID')
예제 #2
0
 def test_update_identifiers(self, mock_update):
     testWork = Work()
     testWork.tmp_identifiers = ['id1']
     testWork.updateIdentifiers()
     mock_update.assert_has_calls([call('id1')])