Skip to content

Commit

Permalink
Adding a real test string, and formatting a line of code to pass
Browse files Browse the repository at this point in the history
PyFlake's test
  • Loading branch information
meetmangukiya committed Sep 20, 2016
1 parent 7f5bdd8 commit 726fe92
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion auslib/blobs/apprelease.py
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,9 @@ def getHeaderXML(self, updateQuery, update_type, whitelistedDomains, specialForc
return ''

def getInnerXML(self, updateQuery, update_type, whitelistedDomains, specialForceHosts):
tmp_url = self['detailsUrl'].replace("%LOCALE%", updateQuery['locale']).replace("%VERSION%", updateQuery['version']).replace("%OS%", updateQuery['buildTarget'].split('_')[0])
tmp_url = self['detailsUrl'].replace("%LOCALE%", updateQuery['locale'])\
.replace("%VERSION%", updateQuery['version'])\
.replace("%OS%", updateQuery['buildTarget'].split('_')[0])
xml = []
xml.append(' <update type="%s" unsupported="true" detailsURL="%s" displayVersion="%s">' % (update_type, tmp_url, self["displayVersion"]))
return xml
Expand Down
4 changes: 2 additions & 2 deletions auslib/test/blobs/test_apprelease.py
Original file line number Diff line number Diff line change
Expand Up @@ -1650,14 +1650,14 @@ def setUp(self):
""")

def testDesupport(self):
updateQuery = {"locale": "<locale>", "version": "<version>", "buildTarget": "<OS_Something>"}
updateQuery = {"locale": "<locale>", "version": "<version>", "buildTarget": "Darwin_x86_64-gcc3-u-i386-x86_64"}
returned_header = self.blob.getHeaderXML(updateQuery, "minor", self.whitelistedDomains, self.specialForceHosts)
returned = self.blob.getInnerXML(updateQuery, "minor", self.whitelistedDomains, self.specialForceHosts)
returned_footer = self.blob.getFooterXML(updateQuery, "minor", self.whitelistedDomains, self.specialForceHosts)
returned = [x.strip() for x in returned]
expected_header = ""
expected = ["""
<update type="minor" unsupported="true" detailsURL="http://moo.com/<locale>/cow/<version>/<OS" displayVersion="50.0">
<update type="minor" unsupported="true" detailsURL="http://moo.com/<locale>/cow/<version>/Darwin" displayVersion="50.0">
"""]
expected = [x.strip() for x in expected]
expected_footer = "</update>"
Expand Down

0 comments on commit 726fe92

Please sign in to comment.