def test_gsi_creating(self): self.connection.expect._call_.withArguments( self.ActionChecker("DescribeTable", { "TableName": "Table" })).andReturn( _lv.DescribeTableResponse( Table={ "TableStatus": "ACTIVE", "GlobalSecondaryIndexes": [{ "IndexStatus": "CREATING" }] })) self.sleep.expect(3) self.connection.expect._call_.withArguments( self.ActionChecker( "DescribeTable", {"TableName": "Table"})).andReturn( _lv.DescribeTableResponse( Table={ "TableStatus": "ACTIVE", "GlobalSecondaryIndexes": [{ "IndexStatus": "ACTIVE" }] })) self.sleep.expect(3) wait_for_table_activation(self.connection.object, "Table")
def test_table_not_yet_created_on_first_describe(self): self.connection.expect._call_.withArguments( self.ActionChecker("DescribeTable", {"TableName": "Table"})).andRaise( _lv.ResourceNotFoundException) self.sleep.expect(3) self.connection.expect._call_.withArguments( self.ActionChecker( "DescribeTable", {"TableName": "Table"})).andReturn( _lv.DescribeTableResponse(Table={"TableStatus": "ACTIVE"})) self.sleep.expect(3) wait_for_table_activation(self.connection.object, "Table")
def test(self): self.connection.expect._call_.withArguments( self.ActionChecker("DescribeTable", {"TableName": "Table"})).andReturn( _lv.DescribeTableResponse( Table={"TableStatus": "DELETING"})) self.sleep.expect(3) self.connection.expect._call_.withArguments( self.ActionChecker("DescribeTable", {"TableName": "Table"})).andRaise( _lv.ResourceNotFoundException) wait_for_table_deletion(self.connection.object, "Table")