-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #122 from DataDog/backwards
Backwards compatibility tests
- Loading branch information
Showing
8 changed files
with
75 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
""" | ||
ensure old interfaces exist and won't break things. | ||
""" | ||
|
||
|
||
import mongoengine | ||
|
||
from tests.test_tracer import get_dummy_tracer | ||
from tests.contrib import config | ||
|
||
class Singer(mongoengine.Document): | ||
first_name = mongoengine.StringField(max_length=50) | ||
last_name = mongoengine.StringField(max_length=50) | ||
|
||
|
||
def test_less_than_v04(): | ||
# interface from < v0.4 | ||
from ddtrace.contrib.mongoengine import trace_mongoengine | ||
tracer = get_dummy_tracer() | ||
|
||
connect = trace_mongoengine(tracer, service="my-mongo-db", patch=False) | ||
connect(port=config.MONGO_CONFIG['port']) | ||
|
||
lc = Singer() | ||
lc.first_name = 'leonard' | ||
lc.last_name = 'cohen' | ||
lc.save() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
from ddtrace.contrib.mysql import get_traced_mysql_connection | ||
from tests.test_tracer import get_dummy_tracer | ||
from tests.contrib import config | ||
|
||
|
||
def test_pre_v4(): | ||
tracer = get_dummy_tracer() | ||
MySQL = get_traced_mysql_connection(tracer, service="my-mysql-server") | ||
conn = MySQL(**config.MYSQL_CONFIG) | ||
cursor = conn.cursor() | ||
cursor.execute("SELECT 1") | ||
assert cursor.fetchone()[0] == 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters