This repository has been archived by the owner on Feb 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
56 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,26 @@ | ||
# Hello cheatera! | ||
### **Some of us use checkers time to time, some of us haven't used it before, but today everything will change! Introducing pyChecker for php_piscine!!!** | ||
### **Some of us use checkers time to time, some of us haven't used it before, but today everything will change! Introducing Checker for php_piscine!!!** | ||
|
||
So you can ask me: `How can we use these gorgeous unit-tests?` I can easily answer: `You just need to...` | ||
|
||
### 1. Open unit-test folder | ||
|
||
### 2. Watch out for an appropriate test for you | ||
|
||
For example you need to test day01 of your piscine: `test_d01.py` fits perfectly | ||
|
||
### 3. Then you need to configure this test for your purposes | ||
For example your `d01` folder lies this way: | ||
|
||
├── d01 | ||
└── unit-tests | ||
So you need to edit head of `test_d01.py` the next way: | ||
```python | ||
#!/usr/bin/python | ||
Go to `unit-tests` folder and run the `configurator.sh` script with one argument: | ||
|
||
Usage: | ||
|
||
./configurator.sh <Path_to_your_php_piscine_folder> | ||
|
||
from helper import * | ||
Example: | ||
|
||
day_location = "../d01/" | ||
helpers = "helpers_d01/" | ||
./configurator.sh /Users/vbrazas/projects/archive/php_piscine/ | ||
~OR~ | ||
./configurator.sh ../ | ||
|
||
# START OF TESTS START OF TESTS START OF TESTS START OF TESTS | ||
``` | ||
### Congrats! Now unit-test is finally configured and you can easily run it: | ||
```bash | ||
./test_d01.py | ||
``` | ||
Now you can easely use all tests! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#/bin/zsh | ||
|
||
if [[ ! "$1" ]]; then | ||
echo "Usage: ./configurator.sh <Path_to_your_php_piscine_folder>" | ||
exit 1 | ||
fi | ||
|
||
PWD=$(pwd) | ||
PP=$(cd $1; pwd) | ||
|
||
for i in {1..7}; do | ||
k='py' | ||
if (( i == 5 )); then continue; fi | ||
if (( i == 6 )); then k='sh'; fi | ||
sed -i '' -e "s|day_location = .*|day_location = '$PP/d0$i/'|" test_d0${i}.$k | ||
sed -i '' -e "s|helpers = .*|helpers = '$PWD/helpers_d0$i/'|" test_d0${i}.$k | ||
done | ||
|
||
printf "Paths successfully updated to:\n" | ||
echo "Piscine path: $PP" | ||
echo "Helpers path: $PWD" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters