Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(361)

Side by Side Diff: tests/gclient_utils_test.py

Issue 500015: gclient: implement a less hacky relative URL implementation (Closed)
Patch Set: Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« tests/gclient_test.py ('K') | « tests/gclient_test.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import re 6 import re
7 import StringIO 7 import StringIO
8 8
9 import gclient_utils 9 import gclient_utils
10 from super_mox import SuperMoxTestBase 10 from super_mox import SuperMoxTestBase
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 url = "svn://example.com/test" 79 url = "svn://example.com/test"
80 rev = "ac345e52dc" 80 rev = "ac345e52dc"
81 out_url, out_rev = gclient_utils.SplitUrlRevision(url) 81 out_url, out_rev = gclient_utils.SplitUrlRevision(url)
82 self.assertEquals(out_rev, None) 82 self.assertEquals(out_rev, None)
83 self.assertEquals(out_url, url) 83 self.assertEquals(out_url, url)
84 out_url, out_rev = gclient_utils.SplitUrlRevision("%s@%s" % (url, rev)) 84 out_url, out_rev = gclient_utils.SplitUrlRevision("%s@%s" % (url, rev))
85 self.assertEquals(out_rev, rev) 85 self.assertEquals(out_rev, rev)
86 self.assertEquals(out_url, url) 86 self.assertEquals(out_url, url)
87 87
88 88
89 class FullUrlFromRelative(SuperMoxTestBase):
90 def testFullUrlFromRelative(self):
91 base_url = 'svn://a/b/c/d'
92 full_url = gclient_utils.FullUrlFromRelative(base_url, '/crap')
93 self.assertEqual(full_url, 'svn://a/b/crap')
94
95 def testFullUrlFromRelative2(self):
96 base_url = 'svn://a/b/c/d'
97 full_url = gclient_utils.FullUrlFromRelative2(base_url, '/crap')
98 self.assertEqual(full_url, 'svn://a/b/c/crap')
99
100
89 if __name__ == '__main__': 101 if __name__ == '__main__':
90 import unittest 102 import unittest
91 unittest.main() 103 unittest.main()
92 104
93 # vim: ts=2:sw=2:tw=80:et: 105 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« tests/gclient_test.py ('K') | « tests/gclient_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698