Pārlūkot izejas kodu

Add testsuite shortcut to make remote repository testing more robust.

Jonas Borgström 12 gadi atpakaļ
vecāks
revīzija
f3295cf3e8
2 mainītis faili ar 5 papildinājumiem un 2 dzēšanām
  1. 4 1
      darc/remote.py
  2. 1 1
      darc/testsuite/archiver.py

+ 4 - 1
darc/remote.py

@@ -80,7 +80,10 @@ class RemoteRepository(object):
         self.unpacker = msgpack.Unpacker(use_list=False)
         self.msgid = 0
         self.received_msgid = 0
-        args = ['ssh', '-p', str(location.port), '%s@%s' % (location.user or getpass.getuser(), location.host), 'darc', 'serve']
+        if location.host == '__testsuite__':
+            args = [sys.executable, '-m', 'darc.archiver', 'serve']
+        else:
+            args = ['ssh', '-p', str(location.port), '%s@%s' % (location.user or getpass.getuser(), location.host), 'darc', 'serve']
         self.p = Popen(args, bufsize=0, stdin=PIPE, stdout=PIPE)
         self.stdin_fd = self.p.stdin.fileno()
         self.stdout_fd = self.p.stdout.fileno()

+ 1 - 1
darc/testsuite/archiver.py

@@ -219,4 +219,4 @@ class ArchiverTestCase(DarcTestCase):
 
 
 class RemoteArchiverTestCase(ArchiverTestCase):
-    prefix = 'localhost:'
+    prefix = '__testsuite__:'