3 # Copyright 2008 the Melange authors.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 """Tests for the scripts.svn_helper module.
19 For details on running the tests, see:
20 http://code.google.com/p/soc/wiki/TestingGuidelines#Running_the_smoke_tests
22 This test (and the svn_helper module that it tests) requires the pysvn module.
26 # alphabetical order by last name, please
27 '"Todd Larsen" <tlarsen@google.com>',
40 from ..scripts
import svn_helper
43 class SvnHelperTests(unittest
.TestCase
):
44 """pysvn wrapper tests for the svn_helper.py module.
48 self
.client
= pysvn
.Client()
50 def testLsFiles(self
):
51 """Test if lsFiles() contains only file entries, using the SoC SVN repo.
54 'svn_helper_test.py' in svn_helper
.lsFiles(
55 'http://soc.googlecode.com/svn/trunk/tests', client
=self
.client
))
58 'tests/' not in svn_helper
.lsFiles(
59 'http://soc.googlecode.com/svn/trunk', client
=self
.client
))
62 """Test if lsDirs() contains only dir entries, using the SoC SVN repo.
65 'tests/' in svn_helper
.lsDirs(
66 'http://soc.googlecode.com/svn/trunk', client
=self
.client
))
69 'svn_helper_test.py' not in svn_helper
.lsDirs(
70 'http://soc.googlecode.com/svn/trunk/tests', client
=self
.client
))
73 """Test if exists() works on the the SoC SVN repo.
76 True, svn_helper
.exists(
77 'http://soc.googlecode.com/svn/trunk', client
=self
.client
))
80 False, svn_helper
.exists(
81 'http://soc.googlecode.com/svn/does_not_exist', client
=self
.client
))