import pytest
import os
import shutil
import tempfile
import textwrap
import pathlib
import yaml


@pytest.fixture
def config_factory():
    filename = tempfile.NamedTemporaryFile(suffix='.yml', delete=False).name

    def get_config(text_or_dict):
        with open(filename, 'w') as conf:
            if isinstance(text_or_dict, str):
                conf.write(textwrap.dedent(text_or_dict))
            elif isinstance(text_or_dict, dict):
                yaml.dump(text_or_dict, conf)
            else:
                raise ValueError(
                    'A text or dictionary is expected for config_factory.')
        return filename

    yield get_config
    os.remove(filename)


@pytest.fixture
def script_factory():
    filename = tempfile.NamedTemporaryFile(suffix='.sos', delete=False).name

    def get_script(text):
        with open(filename, 'w') as conf:
            conf.write(textwrap.dedent(text))
        return filename

    yield get_script
    os.remove(filename)


@pytest.fixture
def temp_factory():

    temp_fds = []
    temp_dirs = []

    def get_tempfiles(*args, **kwargs):
        content = kwargs.get('content', None)
        for names in args:
            if isinstance(names, str):
                names = [names]
            for name in names:
                if content is None:
                    pathlib.Path(name).touch()
                else:
                    with open(name, 'w') as tf:
                        tf.write(content)
                temp_fds.append(name)
        if 'dir' in kwargs:
            if isinstance(kwargs['dir'], str):
                dirs = [kwargs['dir']]
            else:
                dirs = kwargs['dir']
            for dir in dirs:
                if os.path.isdir(dir):
                    shutil.rmtree(dir)
                os.makedirs(dir, exist_ok=True)
                temp_dirs.append(dir)
        return temp_fds, temp_dirs

    yield get_tempfiles

    for temp_file in temp_fds:
        try:
            if os.path.isfile(temp_file):
                os.remove(temp_file)
        except Exception:
            pass

    for temp_dir in temp_dirs:
        try:
            if os.path.isdir(temp_dir):
                shutil.rmtree(temp_dir)
        finally:
            pass


@pytest.fixture
def clear_now_and_after():
    # This fixture takes one or more file names or directory names and will
    # remove them if they exist, and also after the tests are completed.
    temp_fds = []

    def clear_files_and_dirs():
        for temp_fd in temp_fds:
            try:
                if os.path.isfile(temp_fd):
                    os.remove(temp_fd)
                elif os.path.isdir(temp_fd):
                    shutil.rmtree(temp_fd)
            except Exception:
                pass

    def get_names(*args):
        for names in args:
            if isinstance(names, str):
                temp_fds.append(names)
            else:
                temp_fds.extend(names)

        clear_files_and_dirs()
        return temp_fds

    yield get_names

    clear_files_and_dirs()

@pytest.fixture
def sample_workflow():
    with open('sample_workflow.ipynb', 'w') as sn:
        sn.write(r'''{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "kernel": "SoS"
   },
   "outputs": [],
   "source": [
    "# this is a test workflow"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "kernel": "SoS"
   },
   "source": [
    "This is a markdown cell"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "kernel": "R"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "This is a cell with another kernel"
     ]
    }
   ],
   "source": [
    "cat('This is a cell with another kernel')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "kernel": "SoS"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "This is a scratch cell\n"
     ]
    }
   ],
   "source": [
    "print('This is a scratch cell')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "kernel": "SoS"
   },
   "outputs": [],
   "source": [
    "# this comment will be included but not shown in help message\n",
    "# because it is for the global\n",
    "[global]\n",
    "a = 1\n",
    "# this comment will become the comment for parameter b\n",
    "parameter: b=2\n",
    "parameter: c=3\n",
    "# this comment will become the comment for parameter d\n",
    "parameter: d='d'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "kernel": "SoS"
   },
   "outputs": [],
   "source": [
    "# this comment will not be included in exported workflow\n",
    "# because it is not immediately before section\n",
    "\n",
    "# this is a section comment, will be displayed\n",
    "[default]\n",
    "print(f'Hello {a}')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "SoS",
   "language": "sos",
   "name": "sos"
  },
  "language_info": {
   "codemirror_mode": "sos",
   "file_extension": ".sos",
   "mimetype": "text/x-sos",
   "name": "sos",
   "nbconvert_exporter": "sos_notebook.converter.SoS_Exporter",
   "pygments_lexer": "sos"
  },
  "sos": {
   "default_kernel": "SoS",
   "kernels": [
    [
     "R",
     "ir",
     "R",
     "#DCDCDA"
    ],
    [
     "SoS",
     "sos",
     "",
     ""
    ]
   ],
   "panel": {
    "displayed": true,
    "height": 0,
    "style": "side"
   },
   "version": "0.9.14.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
''')


@pytest.fixture
def fastq_files():
    if not os.path.isdir('data'):
        os.mkdir('data')
    with open('data/S20_R1.fastq', 'w') as R1:
        R1.write('''\
@ST-J00106:29:H3C5HBBXX:4:1101:1172:1000 1:N:0:TGACCA
CCTCAGTTCCTCAAACACAGTGAGTGAGTACGGACCTCAGGCTGTCTCTTCGCGTCACACCCGCTGTGAAATGGCAGATACAGCATCAGGGCAGACACTC
+
<<AAFKKKKKKKKKFKFKK7FKKKKKFK,7,<AFF<7,AAKKAK,FK7FKA,7A,,,,7,,,<(F<K7,F,,7<A<,,AA,<,<<,A7,F,(A7A7,AAK
@ST-J00106:29:H3C5HBBXX:4:1101:1375:1000 1:N:0:TGACCA
ATATGCATTCATATAAGTTCATGTCATGCAGCTGACAAATAGAATGATATAGCTCAACTCTACTCATGGATGCCGAACGATGTCTGTGGCTTGCACTGTG
+
AAFFAKKKFKKKKFKKKKKFKKKFKAFKKKKKKKKKKKKFKKKKAKKFKKKKF7FF<FKK<KKKFKKKKFKKKKKFAAKF,,AFFKK7,,7F7AFKK,FK
@ST-J00106:29:H3C5HBBXX:4:1101:1395:1000 1:N:0:TGACCA
CTGTTACCATGTTAATAGCCACACCCTTATGGCCAAACCATCCACCTGTATCCACAGAATTGGTCGAGGTGGATGGTTTGGCCATAAGGGTGTTGCTATG
+
AAAFFKKKKKFKKKKKKKKAKKKFFAFAFAKKKFKKKKFKKFKKAAAA7FFFAFKKKKA<AKKKKKFFK,,AAFFF<,,7F,,A,F<<F,F7F,FFKFAF
@ST-J00106:29:H3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AATTGGCAGATTCACCAAGATGGAAATGAACGAAAAAATATT
+
AAFFAKKKKKKKKKKKKKKKKKKKKKKKKKKKAKKKKKKKKKKKKKFKKKKKKKAKKKFKKFK,FF7A,,AKFFFKKKAKKFFA,,FKFKKKKFKKA<AK
@ST-J00106:29:H3C5HBBXX:4:1101:2086:1000 1:N:0:TGACCA
TACCAACAAATGCAAAAACACAAACCAGTGGTAAATATGCAGACCAGCGATACTAGAAAGCAGCCACACAAACAAGACAGCATAATAACCAGCTAAGAAC
+
AAFA<FAKAAFKAKKKKKKF<AAFKKKK,A,A,FFFF,<<FKKF7FKK<A7AAAF,<FKKAF<,,A,A,AFF7A7<FA,7,A,,A,FKF,F,7,AFFKKK
@ST-J00106:29:H3C5HBBXX:4:1101:2187:1000 1:N:0:TGACCA
CCTTTCCCAGTCCACTAAATAAATGTTAATCTCCTTTGGCAACACCCTCACAGACACAACCGGGAAAAACACTTTGGATCCTTCGATCCAAT
+
AAAFFKKKKKFKKKKKKKKKKKKKKAKFFFKAFKKKKKKKKKKKKFKKKKKKKKKKKKKKKKK<FKKKKKKKKKKKKFFKAAAKKKKK<KK<
@ST-J00106:29:H3C5HBBXX:4:1101:2207:1000 1:N:0:TGACCA
GAAGAGCACACGTCTGAACTCCAGTCACTGACCAATCTCGTATGCCGTCTTCTGCTTGAAAAAAAAAAAAAAAAGAAGCAGGGAATGATTCCCTACCGG
+
AAFFFKKKKKKKFKKKKKKFKKKKKKKKFKKKKKK7,FFKKKKKKKKAAKKKKKKFFFKKKKKKKKKKA,,,,,,,,,,,,7,,7,,,,,,,,,,,,,,
@ST-J00106:29:H3C5HBBXX:4:1101:2289:1000 1:N:0:TGACCA
TATTGGATAGAATTCTTAATTCATTCTCTATGTTATCTTGAATTTCTTTGAGCTTCCTTAACACAGCTATTGTGAATTCCGATTCACAACACAAAAAC
+
AAFFFKKAKFKKKKKKKKKKKKKKKKKKAK7FFKA,AKKKAKKFKFA<K,<<FKFFFKKA,FFFFKKFKKKFKFA7F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FKKKAFKKAFKKKKKKKFKKKK7F,FA(,F7AKKKKKFKKKK<KFF(FAAKF7AA77
@ST-J00106:29:H3C5HBBXX:4:1101:3425:1000 1:N:0:TGACCA
ACCAGAACCACTTTTTGGCTCCTTCTATAGTTTGAGTATGTCATCTTTATTTCTAAGTCTGTATGATATCAATTTTGCATTAGCACCTCGACTTTGA
+
AAFFFKKKKKKKKKKKKKKAKKKKKKKKKKKKKKKKFKKKKKKKKFKKKKFF7AKKFFKKFKKKKKFKKKKKKKFFKKKK7FAKKFKFAA,FKKKAA
@ST-J00106:29:H3C5HBBXX:4:1101:3446:1000 1:N:0:TGACCA
AGCCTAGACCTTTACCTGCATCTCCCTCAGGGCTAACTTCCCAAGACAGTGGCAGGTAAAGGTCTAGGCTCTCCACTTAGAC
+
AAFFFKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKFKKKKKFFKKKKKKKKKKKKKKKKKK
@ST-J00106:29:H3C5HBBXX:4:1101:3466:1000 1:N:0:TGACCA
AAGGTTGTAGAGTGACCTACAGGTGAACAGCTCTGCTCCTCCCAACTGTTCGACCACTGCTCTCACCTCCACACAATCCCAGTGGCCCCTCGCTCTCCCT
+
A<<FAA,,FFKA<FKKKKKKKAAFKFFKKAKKKFAF7AA,F<AKFFKAAAAKFKF,FFK,7,FFK,,<AA7FKFF<,7AFKKKKF7<((<F<(,A<AA<7
@ST-J00106:29:H3C5HBBXX:4:1101:3507:1000 1:N:0:TGACCA
AGTGAAAATAGCGTTAACTGATGACATTCCACAATTGTGATTTGTTTCTGCCCCACCCTAACTGATCAATGTACTTTGTAATCTCCCCCACCCTTAAGA
+
AAAFFKKKKKKKKKKKKKKKKKKKKKKKFKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKFKKK7FK<AAKKK,7FAKK,<FAFKKKKKKK<KKKFK
''')
    with open('data/S20_R2.fastq', 'w') as R2:
        R2.write('''\
@ST-J00106:29:H3C5HBBXX:4:1101:1172:1000 2:N:0:TGACCA
AGGATAAGCAGTCCAAGGAGGCATTGACCAAAACATGCAGTGAAATGTTGATGCGGAGCCTAAAGGACGGGGATCTGGGGGAGCCACGCCTGGAGGCG
+
A<,,,,,7A<F7,,,7,,,,,(,7,,,7,,,7<7,,7<7,,,,7,7A,,,,,,7,,,,(,AF,7,A,,,((,,77<<,7(,F7((A,(((7(<,,7A,
@ST-J00106:29:H3C5HBBXX:4:1101:1375:1000 2:N:0:TGACCA
TGAGAATCTATGGGCATGTGTAGTGTTACATAAGTGGGGTCACATACTGGATAGCAAAGTGCAAGACACAGACATCGTTCGGCATCCATGAGTAGAGTTG
+
<AA<FFFFKKKKKKFFKK7KKAKFF7FAFA,KAKKKAK<7AFKF,FAFFKKKKKKKKAFKKKFFKKKF,AFAF7AKFKA,,77AFA7FAFK<,FFAK<AF
@ST-J00106:29:H3C5HBBXX:4:1101:1395:1000 2:N:0:TGACCA
AGTCCTCTTGTCTTCTTCTGTTACCATGTTAATAGCCACACCCTTATGGCCAAACCATCCACCTCGACCAATTCTGTGGATACAGGTGGATGGTTTGGCC
+
AAFAFKKKFKKKKKKKKKKKKKKKKKKKFAKKKKKKKKKKK7F,AKKAKKKKKKKKK,FFKF<KAKKF<<AAF7FK7F<FAK<FFFAFF7<<KKAAFK7,
@ST-J00106:29:H3C5HBBXX:4:1101:1497:1000 2:N:0:TGACCA
AGGCGAATCGATGTGGCTCCCCCAGCCCCTTCCTGGGAGCATCCTAGAAAGACAGCGTGGAAACGCGCACGGCCTGGTGGTCCCGGTAGCGGCCATGGTG
+
AAFFFFAAFKKKKFKKKAKKKKKKKKKKKFKKK,7AAKFKK<KKFAKK,FAAKKAKKFK<FFKKKFF<(7<<F<FFAK7AAFKK<(<F,K7AFKF,AA<F
@ST-J00106:29:H3C5HBBXX:4:1101:1598:1000 2:N:0:TGACCA
AAAACTGAAAGTTCCAGGGGAAGTGGAAAGGATCACCACCTGCAGAGTCAGATATTCACTTCTGGTAACTCTGTGGACCTTTGGCAGG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