Personally I would of done something closer to (only one hardcoded path)
=== modified file 'tests/autopilot/ubuntu_weather_app/tests/__init__.py' --- tests/autopilot/ubuntu_weather_app/tests/__init__.py 2013-12-17 17:09:10 +0000 +++ tests/autopilot/ubuntu_weather_app/tests/__init__.py 2013-12-17 17:25:10 +0000 @@ -89,13 +89,14 @@ return self.app.select_single("QQuickView")
def ensure_db(self): - db_dir = "~/.local/share/com.ubuntu.weather/Databases/" + weather_dir = os.path.expanduser( + "~/.local/share/com.ubuntu.weather") + db_dir = os.path.join(weather_dir, 'Databases') db_file = "34e1e542f2f083ff18f537b07a380071.sqlite" - abs_path = os.path.expanduser(db_dir) - db_path = os.path.join(abs_path, db_file) + db_path = os.path.join(db_dir, db_file)
if not os.path.exists(db_path): - os.makedirs(os.path.expanduser("~/.local/share/com.ubuntu.weather")) + os.makedirs(weather_dir) shutil.copytree("ubuntu_weather_app/Databases/", db_dir) self.assertThat( lambda: os.path.exists(db_path),
« Back to merge proposal
Personally I would of done something closer to (only one hardcoded path)
=== modified file 'tests/ autopilot/ ubuntu_ weather_ app/tests/ __init_ _.py' /ubuntu_ weather_ app/tests/ __init_ _.py 2013-12-17 17:09:10 +0000 /ubuntu_ weather_ app/tests/ __init_ _.py 2013-12-17 17:25:10 +0000 select_ single( "QQuickView" )
--- tests/autopilot
+++ tests/autopilot
@@ -89,13 +89,14 @@
return self.app.
def ensure_db(self): share/com. ubuntu. weather/ Databases/ " share/com. ubuntu. weather" ) join(weather_ dir, 'Databases') ff18f537b07a380 071.sqlite" expanduser( db_dir) join(abs_ path, db_file) join(db_ dir, db_file)
- db_dir = "~/.local/
+ weather_dir = os.path.expanduser(
+ "~/.local/
+ db_dir = os.path.
db_file = "34e1e542f2f083
- abs_path = os.path.
- db_path = os.path.
+ db_path = os.path.
if not os.path. exists( db_path) : os.path. expanduser( "~/.local/ share/com. ubuntu. weather" )) weather_ dir)
shutil. copytree( "ubuntu_ weather_ app/Databases/ ", db_dir)
self. assertThat(
lambda: os.path. exists( db_path) ,
- os.makedirs(
+ os.makedirs(