def __repr__(self):
return self.render_as_string()
+ def __copy__(self):
+ return __class__.create(
+ self.drivername,
+ self.username,
+ self.password,
+ self.host,
+ self.port,
+ self.database,
+ self.query,
+ )
+
+ def __deepcopy__(self, memo):
+ return self.__copy__()
+
def __hash__(self):
return hash(str(self))
from unittest.mock import call
from unittest.mock import MagicMock
from unittest.mock import Mock
+import copy
+import warnings
import sqlalchemy as tsa
from sqlalchemy import create_engine
is_true(url1 != url3)
is_false(url1 == url3)
+ def test_warnings(self):
+ assert_raises(
+ exc.SADeprecationWarning,
+ url.URL,
+ "dbtype"
+ )
+ url1 = url.URL.create("dbtype")
+ url2 = copy.copy(url1)
+ url3 = copy.deepcopy(url2)
+ is_true(url1 == url2)
+ is_true(url2 == url3)
+
@testing.combinations(
"drivername",
"username",