<commit_before># Test script for genome_util package - it should be launched from
# the root of the genome_util module, ideally just with 'make test', as
# it looks for a hardcoded relative path to find the 'test.cfg' file
import unittest
import json
import ConfigParser

from pprint import pprint

from subprocess import call

from biokbase.auth import Token

# Before all the tests, read the config file and get a user token and
# save it to a file used by the main service script
class TestRNASeqMethodsSetup(unittest.TestCase):
  def setUp(self):
    config = ConfigParser.RawConfigParser()
    config.read('test/test.cfg')
    user_id = config.get('KBaseRNASeqTest','user')
    password = config.get('<PASSWORD>','password')
    token = Token(user_id=user_id, password=password)
    token_file = open('test/script_test/token.txt','w')
    token_file.write(token.token)

# Define all our other test cases here
class TestRNASeqMethods(TestRNASeqMethodsSetup): 

# def test_SetupRNASeqAnalysis(self):
#        print("\n\n----------- test SetupRNASeqAnalysis ----------")
#
#        out =call(["run_KBaseRNASeq.sh",
#        "test/script_test/m_setupRNASeq.json",
#        "test/script_test/bowtie_output.json",
#        "test/script_test/token.txt"])
#
#        # print error code of Implementation
#        print(out);
#
#        with open('test/script_test/bowtie_output.json') as o:
#                output =json.load(o)
#        pprint(output)
#  
# def test_associateReads(self):
#       print("\n\n----------- test associateReads ----------")
#
#       out =call(["run_KBaseRNASeq.sh",
#       "test/script_test/test_associateReads_input.json",
#       "test/script_test/test_associateReads_output.json",
#       "test/script_test/token.txt"])
#
#       # print error code of Implementation
#       print(out);
#
#       with open('test/script_test/test_associateReads_output.json') as o:
#               output =json.load(o)
#       pprint(output)
#
# def test_BuildBowtie2Index(self):
#       print("\n\n----------- test BuildBowtie2index ----------")
#
#       out =call(["run_KBaseRNASeq.sh",
#       "test/script_test/bowtie_input.json",
#       "test/script_test/bowtie_output.json",
#       "test/script_test/token.txt"])
#
#       # print error code of Implementation
#       print(out);
#
#       with open('test/script_test/bowtie_output.json') as o:
#               output =json.load(o)
#       pprint(output)
#
 def test_Bowtie2Call(self):
        print("\n\n----------- test Bowtie2Call ----------")

        out =call(["run_KBaseRNASeq.sh",
        "test/script_test/test_analysis2_bowtie2_input.json",
        "test/script_test/test_analysis2_bowtie2_output.json",
        "test/script_test/token.txt"])

        # print error code of Implementation
        print(out);

        with open('test/script_test/test_analysis2_bowtie2_output.json') as o:
                output =json.load(o)
        pprint(output)

# def test_Bowtie2Call(self):
#        print("\n\n----------- test Bowtie2Call ----------")
#
#        out =call(["run_KBaseRNASeq.sh",
#        "test/script_test/test_analysis1_bowtie2_input.json",
#        "test/script_test/test_analysis1_bowtie2_output.json",
#        "test/script_test/token.txt"])
#
#        # print error code of Implementation
#        print(out);
#
#        with open('test/script_test/test_analysis1_bowtie2_output.json') as o:
#                output =json.load(o)
#        pprint(output)

# def test_TophatCall(self):<commit_msg>Changes in basic_test.py were reverted (part 2)<commit_after># Test script for genome_util package - it should be launched from
# the root of the genome_util module, ideally just with 'make test', as
# it looks for a hardcoded relative path to find the 'test.cfg' file
import unittest
import json
import ConfigParser

from pprint import pprint

from subprocess import call

from biokbase.auth import Token

# Before all the tests, read the config file and get a user token and
# save it to a file used by the main service script
class TestRNASeqMethodsSetup(unittest.TestCase):
  def setUp(self):
    config = ConfigParser.RawConfigParser()
    config.read('test/test.cfg')
    user_id = config.get('KBaseRNASeqTest','user')
    password = config.get('KBaseRNASeqTest','password')
    token = Token(user_id=user_id, password=password)
    token_file = open('test/script_test/token.txt','w')
    token_file.write(token.token)

# Define all our other test cases here
class TestRNASeqMethods(TestRNASeqMethodsSetup): 

# def test_SetupRNASeqAnalysis(self):
#        print("\n\n----------- test SetupRNASeqAnalysis ----------")
#
#        out =call(["run_KBaseRNASeq.sh",
#        "test/script_test/m_setupRNASeq.json",
#        "test/script_test/bowtie_output.json",
#        "test/script_test/token.txt"])
#
#        # print error code of Implementation
#        print(out);
#
#        with open('test/script_test/bowtie_output.json') as o:
#                output =json.load(o)
#        pprint(output)
#  
# def test_associateReads(self):
#       print("\n\n----------- test associateReads ----------")
#
#       out =call(["run_KBaseRNASeq.sh",
#       "test/script_test/test_associateReads_input.json",
#       "test/script_test/test_associateReads_output.json",
#       "test/script_test/token.txt"])
#
#       # print error code of Implementation
#       print(out);
#
#       with open('test/script_test/test_associateReads_output.json') as o:
#               output =json.load(o)
#       pprint(output)
#
# def test_BuildBowtie2Index(self):
#       print("\n\n----------- test BuildBowtie2index ----------")
#
#       out =call(["run_KBaseRNASeq.sh",
#       "test/script_test/bowtie_input.json",
#       "test/script_test/bowtie_output.json",
#       "test/script_test/token.txt"])
#
#       # print error code of Implementation
#       print(out);
#
#       with open('test/script_test/bowtie_output.json') as o:
#               output =json.load(o)
#       pprint(output)
#
# def test_Bowtie2Call(self):
#        print("\n\n----------- test Bowtie2Call ----------")
#
#        out =call(["run_KBaseRNASeq.sh",
#        "test/script_test/test_analysis2_bowtie2_input.json",
#        "test/script_test/test_analysis2_bowtie2_output.json",
#        "test/script_test/token.txt"])
#
#        # print error code of Implementation
#        print(out);
#
#        with open('test/script_test/test_analysis2_bowtie2_output.json') as o:
#                output =json.load(o)
#        pprint(output)

 def test_Bowtie2Call(self):
        print("\n\n----------- test Bowtie2Call ----------")

        out =call(["run_KBaseRNASeq.sh",
        "test/script_test/test_analysis1_bowtie2_input.json",
        "test/script_test/test_analysis1_bowtie2_output.json",
        "test/script_test/token.txt"])

        # print error code of Implementation
        print(out);

        with open('test/script_test/test_analysis1_bowtie2_output.json') as o:
                output =json.load(o)
        pprint(output)

# def test_TophatCall(self):
{'fraction_non_alphanumeric': 0.1465603190428714, 'fraction_numerical': 0.0052699045719982905, 'mean_word_length': 2.775268817204301, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '7367106', 'n_tokens_mistral': 2363, 'n_tokens_neox': 2243, 'n_words': 447}