Skip to content

Commit

Permalink
Changed unit tests to model new fates
Browse files Browse the repository at this point in the history
We want to test chainging fates so created a fate that creates another fate
  • Loading branch information
Digant C Kasundra committed May 18, 2015
1 parent cb9ec26 commit 087d6e0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion db/bootstrap.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ VALUES
(1,'system-reboot','required','This system requires a reboot.'),
(2,'system-reboot','completed','This system rebooted.'),
(3,'system-maintenance','required','This system requires maintenance.'),
(4,'system-maintenance','ready','This system is ready for maintenance.');
(4,'system-maintenance','ready','This system is ready for maintenance.'),
(5,'system-maintenance','completed','System maintenance completed.');

UNLOCK TABLES;
Expand Down
4 changes: 2 additions & 2 deletions tests/model_tests/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

def test_creation(sample_data1):
event_types = sample_data1.query(models.EventType).all()
assert len(event_types) == 6
assert len(event_types) == 7
event_type1 = event_types[0]
assert len(event_type1.events) == 1

Expand Down Expand Up @@ -41,7 +41,7 @@ def test_creation(sample_data1):
def test_duplicate(sample_data1):
"""Test to ensure duplicate events are fine b/c there can be multiple identical events"""
event_types = sample_data1.query(models.EventType).all()
assert len(event_types) == 6
assert len(event_types) == 7
event_type1 = event_types[0]

hosts = sample_data1.query(models.Host).all()
Expand Down
4 changes: 2 additions & 2 deletions tests/model_tests/test_fates.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

def test_creation(sample_data1):
event_types = sample_data1.query(models.EventType).all()
assert len(event_types) == 6
assert len(event_types) == 7

event_type4 = event_types[4]
event_type5 = event_types[5]
Expand Down Expand Up @@ -38,7 +38,7 @@ def test_creation(sample_data1):

def test_duplicate(sample_data1):
event_types = sample_data1.query(models.EventType).all()
assert len(event_types) == 6
assert len(event_types) == 7

event_type1 = event_types[0]
event_type2 = event_types[1]
Expand Down
10 changes: 7 additions & 3 deletions tests/sample_data/sample_data1.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,19 @@ VALUES

INSERT INTO event_types
VALUES
(4,'system-maintenance','completed','System maintenance completed.');
(4,'system-maintenance','ready','This system is ready for maintenance.');

INSERT INTO event_types
VALUES
(5,'system-shutdown','required','System shutdown required.');
(5,'system-maintenance','completed','System maintenance completed.');

INSERT INTO event_types
VALUES
(6,'system-shutdown','complete','System shutdown complete.');
(6,'system-shutdown','required','System shutdown required.');

INSERT INTO event_types
VALUES
(7,'system-shutdown','complete','System shutdown complete.');

INSERT INTO fates
VALUES
Expand Down

0 comments on commit 087d6e0

Please sign in to comment.