Example #1
0
 def __init__(self, *args, **kwargs):
     super(ReaderControllerTestCase, self).__init__(*args, **kwargs)
     self.reader_1 = factories.ReaderFactory(hostname='ingest-station-1',
                                             device='/dev/md0',
                                             status=Reader.Status.EMPTY,
                                             ingest_state=Reader.IngestState.IDLE)
     self.reader_2 = factories.ReaderFactory()
Example #2
0
 def test_invalid_port(self):
     with self.assertRaises(ValueError) as error:
         factories.ReaderFactory(port=100)
     self.assertEqual('port must be a string', str(error.exception))
Example #3
0
 def test_invalid_updated_at(self):
     with self.assertRaises(ValueError) as error:
         factories.ReaderFactory(updated_at='2017-10-22T10:30:43')
     self.assertEqual('updated_at must be of type datetime', str(error.exception))
Example #4
0
 def test_invalid_message(self):
     with self.assertRaises(ValueError) as error:
         factories.ReaderFactory(message=123)
     self.assertEqual('message must be a string', str(error.exception))
Example #5
0
 def test_invalid_mount(self):
     with self.assertRaises(ValueError) as error:
         factories.ReaderFactory(mount=456)
     self.assertEqual('mount must be a string', str(error.exception))
Example #6
0
 def test_invalid_ingest_state(self):
     with self.assertRaises(ValueError) as error:
         factories.ReaderFactory(ingest_state='fake-state')
     self.assertEqual("'fake-state' is not a valid IngestState",
                      str(error.exception))
Example #7
0
 def test_invalid_status(self):
     with self.assertRaises(ValueError) as error:
         factories.ReaderFactory(status='fake-status')
     self.assertEqual("'fake-status' is not a valid Status", str(error.exception))
Example #8
0
 def test_invalid_device(self):
     with self.assertRaises(ValueError) as error:
         factories.ReaderFactory(device='')
     self.assertEqual('device must be a non-empty string', str(error.exception))
Example #9
0
 def test_invalid_reader_id(self):
     with self.assertRaises(ValueError) as error:
         factories.ReaderFactory(reader_id='')
     self.assertEqual('reader_id must be a non-empty string', str(error.exception))
Example #10
0
 def __init__(self, *args, **kwargs):
     super(ReaderModelTestCase, self).__init__(*args, **kwargs)
     self.reader_1 = factories.ReaderFactory()