<commit_before>import unittest
import webservice.start_ws
import test_utils
import json
test_app = webservice.start_ws.app.test_client()

valid_codes = [200,201,302]

class TestWSStatic(test_utils.TestSetup):

#  '/map/', '/',  , '/[filename]', '//[path:filename]'
    def test_main_page(self):
        rv = test_app.get("/")
        self.assertTrue(rv.status_code in valid_codes, "Wrong return code. Code was : " + str(rv.status_code))
        print(dir(test_app))
        print(dir(test_app.application))

    def test_static_file(self):
        rv = test_app.get("/player.html")
        self.assertTrue(rv.status_code in valid_codes, "Wrong return code. Code was : " + str(rv.status_code))
        rv = test_app.get("/bootstrap.min.css")
        self.assertTrue(rv.status_code in valid_codes, "Wrong return code. Code was : " + str(rv.status_code))



class TestWSPlayer(test_utils.TestSetup):
    def test_available_json(self):
        rv = test_app.get("/player/available.json")
        self.assertTrue(rv.status_code in valid_codes, "Wrong return code. Code was : " + str(rv.status_code))
        try:
            json.loads(rv.data)
        except:
            self.assertFalse(True, "Wrong json data")
#  '/player/current', '/player/pause', '/player/stop', '/player/play', '/player/next', '/player/prev',
    def test_available(self):
        url = "/player/available/"
        rv = test_app.get(url)
        self.assertTrue(rv.status_code in valid_codes, "Wrong return code. Code was : " + str(rv.status_code))


class TestWSControl(test_utils.TestSetup):
# '/control/directory/', '/control/createurl/', '/control/createurl/[entry]',
    def test_add_dir(self):
        url = "/control/directory/"
        rv = test_app.get(url)
        self.assertTrue(rv.status_code in valid_codes, "Wrong return code. Code was : " + str(rv.status_code))
        payload = {"text":"newdir"}
        test_app.post(url, content_type='multipart/form-data', data=payload)

    def test_upload_playlist(self):
        url = "/upload/playlist/"
        rv = test_app.get(url)
        self.assertTrue(rv.status_code in valid_codes, "Wrong return code. Code was : " + str(rv.status_code))

    def test_upload(self):
        url = "/upload/music/"
        rv = test_app.get(url)
        self.assertTrue(rv.status_code in valid_codes, "Wrong return code. Code was : " + str(rv.status_code))


class TestWSStage(test_utils.TestSetup):
    def test_save(self):
        url = "/stage/save/"
        rv = test_app.get(url)
        self.assertTrue(rv.status_code in valid_codes, "Wrong return code. Code was : " + str(rv.status_code))

    def test_clear(self):
        url = "/stage/clear/"
        rv = test_app.get(url)
        self.assertTrue(rv.status_code in valid_codes, "Wrong return code. Code was : " + str(rv.status_code))

    def test_stage_json(self):
        rv = test_app.get("stage.json")
        self.assertTrue(rv.status_code in valid_codes, "Wrong return code. Code was : " + str(rv.status_code))
        try:
            json.loads(rv.data)
        except:
            self.assertFalse(True, "Wrong json data")

#  '/stage/clear/', '/stage/save/', '/stage.json', '/stage', '/stage/adddir/[entry]', '/stage/add/[entry]'

<commit_msg>Creating stubs for all urls<commit_after>import unittest
import webservice.start_ws
import test_utils
import json
test_app = webservice.start_ws.app.test_client()

valid_codes = [200,201,301, 302]

class TestWSStatic(test_utils.TestSetup):
    def test_main_page(self):
        rv = test_app.get("/")
        self.assertTrue(rv.status_code in valid_codes, "Wrong return code. Code was : " + str(rv.status_code))

    def test_static_file(self):
        rv = test_app.get("/player.html")
        self.assertTrue(rv.status_code in valid_codes, "Wrong return code. Code was : " + str(rv.status_code))
        rv = test_app.get("/bootstrap.min.css")
        self.assertTrue(rv.status_code in valid_codes, "Wrong return code. Code was : " + str(rv.status_code))

    def test_map(self):
        rv = test_app.get("/map")
        self.assertTrue(rv.status_code in valid_codes, "Wrong return code. Code was : " + str(rv.status_code))

class TestWSPlayer(test_utils.TestSetup):
    def test_available_json(self):
        rv = test_app.get("/player/available.json")
        self.assertTrue(rv.status_code in valid_codes, "Wrong return code. Code was : " + str(rv.status_code))
        try:
            json.loads(rv.data)
        except:
            self.assertFalse(True, "Wrong json data")
    def test_current(self):
        url = '/player/current'
        #TODO:write test
    def test_pause(self):
        url = '/player/pause'
        #TODO:write test
    def test_stop(self):
        url = '/player/stop'
        #TODO:write test
    def test_play(self):
        url = '/player/play'
        #TODO:write test
    def test_next(self):
        url = '/player/next'
        #TODO:write test
    def test_prev(self):
        url = '/player/prev',
        #TODO:write test
    def test_available(self):
        url = "/player/available/"
        rv = test_app.get(url)
        self.assertTrue(rv.status_code in valid_codes, "Wrong return code. Code was : " + str(rv.status_code))


class TestWSControl(test_utils.TestSetup):
    def test_add_dir(self):
        url = "/control/directory/"
        rv = test_app.get(url)
        self.assertTrue(rv.status_code in valid_codes, "Wrong return code. Code was : " + str(rv.status_code))
        payload = {"text":"newdir"}
        test_app.post(url, content_type='multipart/form-data', data=payload)

    def test_create_url(self):
        url = "/control/createurl/"
        #TODO:write test

    def test_create_url_entry(self):
        url = "/control/createurl/newurl"
        #TODO:write test

    def test_upload_playlist(self):
        url = "/upload/playlist/"
        rv = test_app.get(url)
        self.assertTrue(rv.status_code in valid_codes, "Wrong return code. Code was : " + str(rv.status_code))

    def test_upload(self):
        url = "/upload/music/"
        rv = test_app.get(url)
        self.assertTrue(rv.status_code in valid_codes, "Wrong return code. Code was : " + str(rv.status_code))


class TestWSStage(test_utils.TestSetup):
    def test_save(self):
        url = "/stage/save/"
        rv = test_app.get(url)
        self.assertTrue(rv.status_code in valid_codes, "Wrong return code. Code was : " + str(rv.status_code))

    def test_clear(self):
        url = "/stage/clear/"
        rv = test_app.get(url)
        self.assertTrue(rv.status_code in valid_codes, "Wrong return code. Code was : " + str(rv.status_code))

    def test_stage_json(self):
        rv = test_app.get("stage.json")
        self.assertTrue(rv.status_code in valid_codes, "Wrong return code. Code was : " + str(rv.status_code))
        try:
            json.loads(rv.data)
        except:
            self.assertFalse(True, "Wrong json data")
    def test_stage(self):
        url = '/stage'
        #TODO:write test
    def test_adddir(self):
        url = '/stage/adddir/' + test_utils.test_dir
        #TODO:write test
    def test_add(self):
        url = '/stage/add/' + test_utils.dot
        #TODO:write test

{'fraction_non_alphanumeric': 0.13322208315950493, 'fraction_numerical': 0.002920317062995411, 'mean_word_length': 2.769392033542977, 'pattern_counts': {'":': 2, '<': 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': '6478486', 'n_tokens_mistral': 2366, 'n_tokens_neox': 2353, 'n_words': 490}