Skip to content

Commit

Permalink
Merge pull request #2562 from cdonati/unblock-tests
Browse files Browse the repository at this point in the history
Mock out blocking calls in unit tests
  • Loading branch information
tmarballi committed Oct 26, 2017
2 parents d8b37e9 + 86806a2 commit 26b76b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions AppDB/test/unit/test_cassandra_backup.py
Expand Up @@ -3,6 +3,7 @@
import re
import sys
import subprocess
import time
import unittest
from flexmock import flexmock

Expand Down Expand Up @@ -102,6 +103,8 @@ def test_restore_data(self):
flexmock(rebalance).should_receive('get_status').and_return(
[{'state': 'UN'} for _ in db_ips])

flexmock(time).should_receive('sleep')

cassandra_backup.restore_data(path, keyname)


Expand Down
1 change: 1 addition & 0 deletions InfrastructureManager/tests/test_ec2_agent.py
Expand Up @@ -123,6 +123,7 @@ def terminate_instances(self, prefix, blocking):
reservation.instances = [instance]
self.fake_ec2.should_receive('get_all_instances').and_return([reservation])

flexmock(i).should_receive('_InfrastructureManager__kill_vms')
result = i.terminate_instances(params2, 'secret')
if not blocking:
time.sleep(.1)
Expand Down

0 comments on commit 26b76b2

Please sign in to comment.