#!/bin/sh

mkdir -p parent/child
touch parent/child/__init__.py
echo "from . import child" > parent/__init__.py
echo "import parent" > cli.py
echo "print('import successful')" >> cli.py

echo "# Running cli.py with Python 2 before migration"
python2 cli.py
rm parent/child/__init__.py
touch parent/child.py
echo "# Running cli.py with Python 3 after migration"
python3 cli.py

rm parent/child/__init__.pyc
echo "# Running cli.py with Python 3 after migration and purging pyc file"
python3 cli.py
