<commit_before># COPYRIGHT 2015 SUSE LLC

rpcApiTester = XMLRPCApiTest.new(ENV["TESTHOST"])

#
# Steps
#
Given /^I am logged in via XML\-RPC\/api as user "([^"]*)" and password "([^"]*)"$/ do |luser, password|
  fail if not rpcApiTester.login(luser, password)
end

When /^I call getApiNamespaces, I should get (\d+) namespaces$/ do |apiCount|
  $stderr.puts "namespaces #{rpcApiTester.getCountOfApiNamespaces()}"
  fail if apiCount.to_i != rpcApiTester.getCountOfApiNamespaces()
end

When /^I call getVersion, I should get "([^"]*)" as result$/ do |version|
  $stderr.puts "version is #{rpcApiTester.getVersion()}"
  fail if not rpcApiTester.getVersion() == version
end

When /^I call systemVersion, I should get "([^"]*)" as result$/ do |version|
  $stderr.puts "systemVersion is #{rpcApiTester.systemVersion()}"
  fail if not rpcApiTester.systemVersion().include? version
end

When /^I call getApiNamespaceCallList, I should get (\d+) available api calls$/ do |apiCount|
  $stderr.puts "API count #{rpcApiTester.getCountOfApiNamespaceCallList()}"
  fail if apiCount.to_i != rpcApiTester.getCountOfApiNamespaceCallList()
end

When /^I call getApiCallList, I should get (\d+) available groups$/ do |groupCount|
  $stderr.puts "available groups: #{rpcApiTester.getCountOfApiCallListGroups()}"
  fail if groupCount.to_i != rpcApiTester.getCountOfApiCallListGroups()
end<commit_msg>Switched to minitest assertions<commit_after># COPYRIGHT 2015 SUSE LLC

rpcApiTester = XMLRPCApiTest.new(ENV["TESTHOST"])

#
# Steps
#
Given /^I am logged in via XML\-RPC\/api as user "([^"]*)" and password "([^"]*)"$/ do |luser, password|
  assert(rpcApiTester.login(luser, password))
end

When /^I call getApiNamespaces, I should get (\d+) namespaces$/ do |apiCount|
  assert_equal(apiCount.to_i, rpcApiTester.getCountOfApiNamespaces())
end

When /^I call getVersion, I should get "([^"]*)" as result$/ do |version|
  fail if not rpcApiTester.getVersion().include? version
end

When /^I call systemVersion, I should get "([^"]*)" as result$/ do |version|
  assert(rpcApiTester.systemVersion().include? version)
end

When /^I call getApiNamespaceCallList, I should get (\d+) available api calls$/ do |apiCount|
  assert_equal(apiCount.to_i, rpcApiTester.getCountOfApiNamespaceCallList())
end

When /^I call getApiCallList, I should get (\d+) available groups$/ do |groupCount|
  assert_equal(groupCount.to_i, rpcApiTester.getCountOfApiCallListGroups())
end
{'fraction_non_alphanumeric': 0.13957307060755336, 'fraction_numerical': 0.003284072249589491, 'mean_word_length': 5.516042780748663, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2757599', 'n_tokens_mistral': 854, 'n_tokens_neox': 816, 'n_words': 235}