[SCM] ci-tooling packaging branch, master, updated. f4fb1412ef5eb30a49adfd5e0b5a2902f4f744fb

Harald Sitter apachelogger-guest at moszumanska.debian.org
Thu Dec 10 11:14:59 UTC 2015


Gitweb-URL: http://git.debian.org/?p=pkg-kde/ci-tooling.git;a=commitdiff;h=f4fb141

The following commit has been merged in the master branch:
commit f4fb1412ef5eb30a49adfd5e0b5a2902f4f744fb
Author: Harald Sitter <sitter at kde.org>
Date:   Thu Dec 10 12:14:56 2015 +0100

    move testing data around to consolidate pathing
---
 test/data/{lp => test_lp}/ppa-sources-kate-1.json     |  0
 test/data/{lp => test_lp}/ppa-sources-kate-2.json     |  0
 test/data/{lp => test_lp}/ppa-sources-kate.json       |  0
 test/data/{lp => test_lp}/ppa.json                    |  0
 test/data/test_lp/token.json                          |  1 +
 test/data/{lp => test_lp}/ubuntu-archive-primary.json |  0
 test/data/{lp => test_lp}/ubuntu-archives1.json       |  0
 test/data/{lp => test_lp}/ubuntu-archives2.json       |  0
 test/data/{lp => test_lp}/ubuntu.json                 |  0
 test/test_lp.rb                                       | 18 ++++++++++++------
 10 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/test/data/lp/ppa-sources-kate-1.json b/test/data/test_lp/ppa-sources-kate-1.json
similarity index 100%
rename from test/data/lp/ppa-sources-kate-1.json
rename to test/data/test_lp/ppa-sources-kate-1.json
diff --git a/test/data/lp/ppa-sources-kate-2.json b/test/data/test_lp/ppa-sources-kate-2.json
similarity index 100%
rename from test/data/lp/ppa-sources-kate-2.json
rename to test/data/test_lp/ppa-sources-kate-2.json
diff --git a/test/data/lp/ppa-sources-kate.json b/test/data/test_lp/ppa-sources-kate.json
similarity index 100%
rename from test/data/lp/ppa-sources-kate.json
rename to test/data/test_lp/ppa-sources-kate.json
diff --git a/test/data/lp/ppa.json b/test/data/test_lp/ppa.json
similarity index 100%
rename from test/data/lp/ppa.json
rename to test/data/test_lp/ppa.json
diff --git a/test/data/test_lp/token.json b/test/data/test_lp/token.json
new file mode 100644
index 0000000..2622c53
--- /dev/null
+++ b/test/data/test_lp/token.json
@@ -0,0 +1 @@
+{"oauth_token":"accesskey","oauth_token":"accesskey","oauth_token_secret":"accesssecret","oauth_token_secret":"accesssecret"}
diff --git a/test/data/lp/ubuntu-archive-primary.json b/test/data/test_lp/ubuntu-archive-primary.json
similarity index 100%
rename from test/data/lp/ubuntu-archive-primary.json
rename to test/data/test_lp/ubuntu-archive-primary.json
diff --git a/test/data/lp/ubuntu-archives1.json b/test/data/test_lp/ubuntu-archives1.json
similarity index 100%
rename from test/data/lp/ubuntu-archives1.json
rename to test/data/test_lp/ubuntu-archives1.json
diff --git a/test/data/lp/ubuntu-archives2.json b/test/data/test_lp/ubuntu-archives2.json
similarity index 100%
rename from test/data/lp/ubuntu-archives2.json
rename to test/data/test_lp/ubuntu-archives2.json
diff --git a/test/data/lp/ubuntu.json b/test/data/test_lp/ubuntu.json
similarity index 100%
rename from test/data/lp/ubuntu.json
rename to test/data/test_lp/ubuntu.json
diff --git a/test/test_lp.rb b/test/test_lp.rb
index cc65503..e4c8b8a 100644
--- a/test/test_lp.rb
+++ b/test/test_lp.rb
@@ -5,8 +5,14 @@ require 'webmock/test_unit'
 require_relative 'lib/testcase'
 require_relative '../lib/lp'
 
-class FakeLaunchpad
-  def self.call(env)
+module FakeLaunchpad
+  class << self
+    attr_accessor :datadir
+  end
+
+  module_function
+
+  def call(env)
     case env['REQUEST_METHOD']
     when 'GET'
       return get(env)
@@ -14,7 +20,7 @@ class FakeLaunchpad
     faile "unhandled http method '#{env['REQUEST_METHOD']}' in #{self}"
   end
 
-  def self.get(env)
+  def get(env)
     path = Pathname.new(env['PATH_INFO']).cleanpath.to_s
     query = env['QUERY_STRING']
     case path
@@ -72,9 +78,8 @@ class FakeLaunchpad
     fail "unhandled get '#{path}?#{env['QUERY_STRING']}' in #{self}"
   end
 
-  def self.json_response(file_name)
-    # FIXME: use @datadir or something
-    File.open("#{__dir__}/data/lp/#{file_name}").read
+  def json_response(file_name)
+    File.read("#{@datadir}/#{file_name}")
   end
 end
 
@@ -249,6 +254,7 @@ end
 class LaunchpadRubberTest < TestCase
   def setup
     Launchpad.instance_variable_set(:@conf_path, Dir.pwd)
+    FakeLaunchpad.datadir = @datadir
 
     WebMock.disable_net_connect!(allow_localhost: true)
     stub_request(:any, /api.launchpad.net/).to_rack(FakeLaunchpad)

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list