예제 #1
0
 def test_add_comment(self, mock_client):
     record = Record(MOCK_RECORD)
     record.add_comment('123', '456', 'Test Comment')
     mock_client.post.assert_called_once_with({
         'message': 'Test Comment',
         'createdDate': mock.ANY,
         'createdByUser': '******'
     }, 'app/456/record/123/123/comment')
예제 #2
0
 def test_add_comment(self, mock_client):
     record = Record(MOCK_RECORD)
     record.add_comment('123', '456', 'Test Comment')
     mock_client.post.assert_called_once_with(
         {
             'message': 'Test Comment',
             'createdDate': mock.ANY
         }, 'app/456/record/123/123/comment')
예제 #3
0
 def test_find(self, mock_client):
     Record.find('123', '456')
     mock_client.get.assert_called_once_with('app/123/record/456')
예제 #4
0
 def test_new_for(self, mock_client):
     Record.new_for('123')
     mock_client.get.assert_called_once_with(
         'app/123/record')
예제 #5
0
 def test_references(self, mock_client):
     record = Record(MOCK_RECORD)
     record.references('123', ['456'], ['789'])
     mock_client.get.assert_called_once_with(
         'app/456/record/123/references?recordIds=456&fieldIds=789')
예제 #6
0
 def test_update(self, mock_client):
     mock_client.put.return_value = MOCK_RECORD
     record = Record(MOCK_RECORD)
     record.update()
     mock_client.put.assert_called_once_with(record, 'app/456/record')
예제 #7
0
 def test_init(self):
     record = Record(MOCK_RECORD)
     for key, value in MOCK_RECORD.items():
         self.assertEqual(getattr(record, key), value)
예제 #8
0
 def test_find(self, mock_client):
     Record.find('123', '456')
     mock_client.get.assert_called_once_with('app/123/record/456')
예제 #9
0
 def test_new_for(self, mock_client):
     Record.new_for('123')
     mock_client.get.assert_called_once_with('app/123/record')
예제 #10
0
 def test_references(self, mock_client):
     record = Record(MOCK_RECORD)
     record.references('123', ['456'], ['789'])
     mock_client.get.assert_called_once_with(
         'app/456/record/123/references?recordIds=456&fieldIds=789')
예제 #11
0
 def test_update(self, mock_client):
     mock_client.put.return_value = MOCK_RECORD
     record = Record(MOCK_RECORD)
     record.isNew = False
     record.update()
     mock_client.put.assert_called_once_with(record, 'app/456/record')
예제 #12
0
 def test_insert(self, mock_client):
     mock_client.post.return_value = MOCK_RECORD
     record = Record(MOCK_RECORD)
     record.insert()
     mock_client.post.assert_called_once_with(record, 'app/456/record')
예제 #13
0
 def _build_record(self, raw_record_data):
     # Avoid circular imports
     from swimlane.core.resources import Record
     return Record(self.app, raw_record_data)