subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1833103 - /subversion/trunk/subversion/tests/cmdline/shelf_tests.py
Date Thu, 07 Jun 2018 08:25:48 GMT
Author: julianfoad
Date: Thu Jun  7 08:25:47 2018
New Revision: 1833103

URL: http://svn.apache.org/viewvc?rev=1833103&view=rev
Log:
Shelving: add a test for 'shelf-list'.

* subversion/tests/cmdline/shelf_tests.py
  (list_shelves): New test.
  (test_list): Run it.

Modified:
    subversion/trunk/subversion/tests/cmdline/shelf_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/shelf_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/shelf_tests.py?rev=1833103&r1=1833102&r2=1833103&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/shelf_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/shelf_tests.py Thu Jun  7 08:25:47 2018
@@ -545,6 +545,45 @@ def shelve_dir_copy(sbox):
 
   shelve_unshelve(sbox, modifier, cannot_shelve=True)
 
+#----------------------------------------------------------------------
+
+def list_shelves(sbox):
+  "list_shelves"
+
+  sbox.build()
+  was_cwd = os.getcwd()
+  os.chdir(sbox.wc_dir)
+  sbox.wc_dir = ''
+
+  # an empty list
+  svntest.actions.run_and_verify_svn([], [],
+                                     'shelf-list', '-q')
+
+  # make two shelves
+  sbox.simple_append('A/mu', 'appended mu text')
+  svntest.actions.run_and_verify_svn(None, [],
+                                     'shelf-save', 'foo')
+  sbox.simple_append('A/mu', 'appended more text')
+  svntest.actions.run_and_verify_svn(None, [],
+                                     'shelf-save', 'foo', '-m', 'log msg')
+  svntest.actions.run_and_verify_svn(None, [],
+                                     'shelf-save', 'bar', '-m', 'log msg')
+
+  # a quiet list
+  expected_out = svntest.verify.RegexListOutput(['foo', 'bar'])
+  svntest.actions.run_and_verify_svn(expected_out, [],
+                                     'shelf-list', '-q')
+
+  # a detailed list
+  expected_out = svntest.verify.RegexListOutput(['foo .* 1 path.*',
+                                                 ' log msg',
+                                                 'bar .* 1 path.*',
+                                                 ' log msg'])
+  svntest.actions.run_and_verify_svn(expected_out, [],
+                                     'shelf-list')
+
+  os.chdir(was_cwd)
+
 
 ########################################################################
 # Run the tests
@@ -573,6 +612,7 @@ test_list = [ None,
               shelve_replace_dir,
               shelve_file_copy,
               shelve_dir_copy,
+              list_shelves,
              ]
 
 if __name__ == '__main__':



Mime
View raw message