Repository navigation
[WIP] Add Python test generator #1547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a10eca6
591656f
cf254d3
7f00e95
3b13703
b471126
fb76088
bde00a6
989bc33
c1e9b4e
db3cf96
99d55e8
7aa4b93
c999dc0
e93669e
2f2ae57
59f3440
2f758dc
6b7a36e
588c82d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,3 +10,6 @@ bin/configlet.exe | |
| .cache | ||
| .pytest_cache | ||
| __pycache__ | ||
|
|
||
| # virtual environments | ||
| venv | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| skip_tests: | ||
| - description: "puzzle with ten letters and 199 addends" | ||
| property: "solve" | ||
| message: "extra-credit" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| properties_map: | ||
| isArmstrongNumber: is_armstrong |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| cases: | ||
| - description: "encode decode" | ||
| property: "decode" | ||
| input: 'encode("Testing, 1 2 3, testing.")' | ||
| expected: "testing123testing" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this for track-specific cases?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. If the input value is a string it'll insert it as is, so |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| properties_map: | ||
| find: binary_search |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| properties_map: | ||
| response: hey |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| properties_map: | ||
| total: calculate_total |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| properties_map: | ||
| findFewestCoins: find_minimum_coins |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| properties_map: | ||
| steps: collatz_steps |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| properties_map: | ||
| ciphertext: encode |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| properties_map: | ||
| rows: make_diamond |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| properties_map: | ||
| differenceOfSquares: difference |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| cases: | ||
| - description: "empty nested lists" | ||
| property: "flatten" | ||
| input: '[[()]]' | ||
| expected: [] | ||
| - description: "strings" | ||
| property: "flatten" | ||
| input: | ||
| array: ['0', ['1', '2']] | ||
| expected: ['0', '1', '2'] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| properties_map: | ||
| square: on_square | ||
| total: total_after | ||
| cases: | ||
| - description: "total of square 0 raises an exception" | ||
| property: "total" | ||
| input: | ||
| square: 0 | ||
| expected: | ||
| error: "square must be between 1 and 64" | ||
| - description: "total of negative square raises an exception" | ||
| property: "square" | ||
| input: | ||
| square: -1 | ||
| expected: | ||
| error: "square must be between 1 and 64" | ||
| - description: "square greater than 64 raises an exception" | ||
| property: "square" | ||
| input: | ||
| square: 65 | ||
| expected: | ||
| error: "square must be between 1 and 64" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| cases: | ||
| - description: "complete distance in single nucleotide strands" | ||
| property: "distance" | ||
| input: | ||
| strand1: "A" | ||
| strand2: "G" | ||
| expected: 1 | ||
|
|
||
| - description: "complete distance in small strands" | ||
| property: "distance" | ||
| input: | ||
| strand1: "AG" | ||
| strand2: "CT" | ||
| expected: 2 | ||
|
|
||
| - description: "small distance in small strands" | ||
| property: "distance" | ||
| input: | ||
| strand1: "AT" | ||
| strand2: "CT" | ||
| expected: 1 | ||
|
|
||
| - description: "small distance" | ||
| property: "distance" | ||
| input: | ||
| strand1: "GGACG" | ||
| strand2: "GGTCG" | ||
| expected: 1 | ||
|
|
||
| - description: "small distance in long strands" | ||
| property: "distance" | ||
| input: | ||
| strand1: "ACCAGGG" | ||
| strand2: "ACTATGG" | ||
| expected: 2 | ||
|
|
||
| - description: "non unique character in first strand" | ||
| property: "distance" | ||
| input: | ||
| strand1: "AAG" | ||
| strand2: "AAA" | ||
| expected: 1 | ||
|
|
||
| - description: "non unique character in second strand" | ||
| property: "distance" | ||
| input: | ||
| strand1: "AAA" | ||
| strand2: "AAG" | ||
| expected: 1 | ||
|
|
||
| - description: "same nucleotides in different positions" | ||
| property: "distance" | ||
| input: | ||
| strand1: "TAG" | ||
| strand2: "GAT" | ||
| expected: 2 | ||
|
|
||
| - description: "large distance" | ||
| property: "distance" | ||
| input: | ||
| strand1: "GATACA" | ||
| strand2: "GCATAA" | ||
| expected: 4 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| properties_map: | ||
| isValid: verify |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| cases: | ||
| - description: "duplicated letter and nonletter character" | ||
| property: "isIsogram" | ||
| input: | ||
| phrase: "Aleph Bot Chap" | ||
| expected: false |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| skip_tests: | ||
| - description: "project euler big number" | ||
| property: "largestProduct" | ||
| message: "extra-credit" | ||
| cases: | ||
| - description: "project euler big number" | ||
| property: "largestProduct" | ||
| input: | ||
| digits: | ||
| "73167176531330624919225119674426574742355349194934969835203127745\ | ||
| 06326239578318016984801869478851843858615607891129494954595017379\ | ||
| 58331952853208805511125406987471585238630507156932909632952274430\ | ||
| 43557668966489504452445231617318564030987111217223831136222989342\ | ||
| 33803081353362766142828064444866452387493035890729629049156044077\ | ||
| 23907138105158593079608667017242712188399879790879227492190169972\ | ||
| 08880937766572733300105336788122023542180975125454059475224352584\ | ||
| 90771167055601360483958644670632441572215539753697817977846174064\ | ||
| 95514929086256932197846862248283972241375657056057490261407972968\ | ||
| 65241453510047482166370484403199890008895243450658541227588666881\ | ||
| 16427171479924442928230863465674813919123162824586178664583591245\ | ||
| 66529476545682848912883142607690042242190226710556263211111093705\ | ||
| 44217506941658960408071984038509624554443629812309878799272442849\ | ||
| 09188845801561660979191338754992005240636899125607176060588611646\ | ||
| 71094050775410022569831552000559357297257163626956188267042825248\ | ||
| 3600823257530420752963450" | ||
| span: 13 | ||
| expected: 23514624000 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| properties_map: | ||
| leapYear: is_leap_year |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| properties_map: | ||
| parse: parse_markdown |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| properties_map: | ||
| annotate: board | ||
| cases: | ||
| - description: "board9" | ||
| property: "annotate" | ||
| input: | ||
| minefield: [" ", " * ", " ", " ", " * "] | ||
| expected: [" 111", " 1*1", " 111", "111 ", "1*1 "] | ||
| - description: "different length" | ||
| property: "annotate" | ||
| input: | ||
| minefield: [" ", "* ", " "] | ||
| expected: | ||
| error: "Board rows must be of the same length" | ||
| - description: "invalid character" | ||
| property: "annotate" | ||
| input: | ||
| minefield: ["X * "] | ||
| expected: | ||
| error: "Illegal characters not allowed." |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| properties_map: | ||
| prime: nth-prime |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| properties_map: | ||
| largest: largest_palindrome | ||
| smallest: smallest_palindrome |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| properties_map: | ||
| factors: prime_factors |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| properties_map: | ||
| rectangles: count |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| properties_map: | ||
| roman: numeral |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| properties_map: | ||
| commands: handshake |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| properties_map: | ||
| primes: sieve |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| properties_map: | ||
| spiralMatrix: spiral |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| properties_map: | ||
| sum: sum_of_multiples |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| properties_map: | ||
| equilateral: is_equilateral | ||
| isosceles: is_isosceles | ||
| scalene: is_scalene |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| properties_map: | ||
| countWords: word_count | ||
| cases: | ||
| - description: "tabs" | ||
| property: "countWords" | ||
| input: | ||
| sentence: "rah rah ah ah ah\troma roma ma\tga ga oh la la\twant your bad romance" | ||
| expected: | ||
| rah: 2 | ||
| ah: 3 | ||
| roma: 2 | ||
| ma: 1 | ||
| ga: 2 | ||
| oh: 1 | ||
| la: 2 | ||
| want: 1 | ||
| your: 1 | ||
| bad: 1 | ||
| romance: 1 | ||
| - description: "non alphanumeric" | ||
| property: "countWords" | ||
| input: | ||
| sentence: "hey,my_spacebar_is_broken." | ||
| expected: | ||
| hey: 1 | ||
| my: 1 | ||
| spacebar: 1 | ||
| is: 1 | ||
| broken: 1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| properties_map: | ||
| answer: calculate | ||
| cases: | ||
| - description: "missing operation" | ||
| property: "answer" | ||
| input: | ||
| question: "What is 2 2 minus 3?" | ||
| expected: | ||
| error: "An operation is missingh" | ||
| - description: "missing number" | ||
| property: "answer" | ||
| input: | ||
| question: "What is 7 plus multiplied by -2?" | ||
| expected: | ||
| error: "A number is missing." |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| imports: | ||
| - YACHT | ||
| - ONES | ||
| - TWOS | ||
| - THREES | ||
| - FOURS | ||
| - FIVES | ||
| - SIXES | ||
| - FULL_HOUSE | ||
| - FOUR_OF_A_KIND | ||
| - LITTLE_STRAIGHT | ||
| - BIG_STRAIGHT | ||
| - CHOICE | ||
| inputs_map: | ||
| category: "lambda c: c.upper().replace(' ', '_')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍