From d70f6a59578d38b655db9a0933b91efc0f44e88a Mon Sep 17 00:00:00 2001 From: berryman Date: Sat, 8 Dec 2012 14:16:17 -0500 Subject: [PATCH] add card files; parse lines from card files and store as Card objects; remove redundant 'card' from Card.attributes; test for card object; --- cards/answer_cards | 540 +++++++++++++++++++++++++++++++++++++++++++ cards/question_cards | 180 +++++++++++++++ plugin.py | 56 ++++- test.py | 11 +- 4 files changed, 774 insertions(+), 13 deletions(-) create mode 100644 cards/answer_cards create mode 100644 cards/question_cards diff --git a/cards/answer_cards b/cards/answer_cards new file mode 100644 index 0000000..c282be4 --- /dev/null +++ b/cards/answer_cards @@ -0,0 +1,540 @@ +A Gypsy curse. +A moment of silence. +A sausage festival. +An honest cop with nothing left to lose. +Famine. +Flesh-eating bacteria. +Flying sex snakes. +Not giving a shit about the Third World. +Sexting. +Shapeshifters. +Porn stars. +Raping and pillaging. +72 virgins. +A drive-by shooting. +A time travel paradox. +Authentic Mexican cuisine. +Bling. +Consultants. +Crippling debt. +Daddy issues. +The Donald Trump Seal of Approval. +Dropping a chandelier on your enemies and riding the rope up. +Former President George W. Bush. +Full frontal nudity. +Hormone injections. +Laying an egg. +Getting naked and watching Nickelodeon. +Pretending to care. +Public ridicule. +Sharing needles. +Boogers. +The inevitable heat death of the universe. +The miracle of childbirth. +The Rapture. +Whipping it out. +White privilege. +Wifely duties. +The Hamburglar. +AXE Body Spray. +The Blood of Christ. +Horrifying laser hair removal accidents. +BATMAN!!! +Agriculture. +A robust mongoloid. +Natural selection. +Coat hanger abortions. +Eating all of the cookies before the AIDS bake-sale. +Michelle Obama's arms. +The World of Warcraft. +Swooping. +Obesity. +A homoerotic volleyball montage. +Lockjaw. +A mating display. +Testicular torsion. +All-you-can-eat shrimp for $4.99. +Domino's Oreo Dessert Pizza. +Kanye West. +Hot cheese. +Raptor attacks. +Taking off your shirt. +Smegma. +Alcoholism. +A middle-aged man on roller skates. +The Care Bear Stare. +Bingeing and purging. +Oversized lollipops. +Self-loathing. +Children on leashes. +Half-assed foreplay. +The Holy Bible. +German dungeon porn. +Being on fire. +Teenage pregnancy. +Gandhi. +Leaving an awkward voicemail. +Uppercuts. +Customer service representatives. +An erection that lasts longer than four hours. +My genitals. +Picking up girls at the abortion clinic. +Science. +Not reciprocating oral sex. +Flightless birds. +A good sniff. +Waterboarding. +A balanced breakfast. +Historically black colleges. +Actually taking candy from a baby. +The Make-A-Wish Foundation. +A clandestine butt scratch. +Passive-aggressive Post-it notes. +The Chinese gymnastics team. +Switching to Geico. +Peeing a little bit. +Home video of Oprah sobbing into a Lean Cuisine. +Nocturnal emissions. +The Jews. +My humps. +Powerful thighs. +Winking at old people. +Mr. Clean, right behind you. +A gentle caress of the inner thigh. +Sexual tension. +The forbidden fruit. +Skeletor. +Fancy Feast. +Being rich. +Sweet, sweet vengeance. +Republicans. +A gassy antelope. +Natalie Portman. +Copping a feel. +Kamikaze pilots. +Sean Connery. +The homosexual agenda. +The hardworking Mexican. +A falcon with a cap on its head. +Altar boys. +The Kool-Aid Man. +Getting so angry that you pop a boner. +Free samples. +A big hoopla about nothing. +Doing the right thing. +The Three-Fifths compromise. +Lactation. +World peace. +RoboCop. +Chutzpah. +Justin Bieber. +Oompa-Loompas. +Inappropriate yodeling. +Puberty. +Ghosts. +An asymmetric boob job. +Vigorous jazz hands. +Fingering. +Glenn Beck catching his scrotum on a curtain hook. +GoGurt. +Police brutality. +John Wilkes Booth. +Preteens. +Scalping. +Stifling a giggle at the mention of Hutus and Tutsis. +"Tweeting." +Darth Vader. +A sad handjob. +Exactly what you'd expect. +Expecting a burp and vomiting on the floor. +Adderall. +Embryonic stem cells. +Tasteful sideboob. +Panda sex. +An icepick lobotomy. +Tom Cruise. +Mouth herpes. +Sperm whales. +Homeless people. +Third base. +Incest. +Pac-Man uncontrollably guzzling cum. +A mime having a stroke. +Hulk Hogan. +God. +Scrubbing under the folds. +Golden showers. +Emotions. +Licking things to claim them as your own. +Pabst Blue Ribbon. +The placenta. +Spontaneous human combustion. +Friends with benefits. +Finger painting. +Old-people smell. +Dying of dysentery. +My inner demons. +A Super Soaker full of cat pee. +Aaron Burr. +Cuddling. +The chronic. +Cockfights. +Friendly fire. +Ronald Reagan. +A disappointing birthday party. +A sassy black woman. +Mathletes. +A tiny horse. +William Shatner. +Riding off into the sunset. +An M. Night Shyamalan plot twist. +Jew-fros. +Mutually-assured destruction. +Pedophiles. +Yeast. +Grave robbing. +Eating the last known bison. +Catapults. +Poor people. +Forgetting the Alamo. +The Hustle. +The Force. +Wiping her butt. +Intelligent design. +Loose lips. +AIDS. +Pictures of boobs. +The Übermensch. +Sarah Palin. +American Gladiators. +Getting really high. +Scientology. +Penis envy. +Praying the gay away. +Frolicking. +Two midgets shitting into a bucket. +The KKK. +Genghis Khan. +Crystal meth. +Serfdom. +Stranger danger. +A Bop It. +Shaquille O'Neal's acting career. +Prancing. +Vigilante justice. +Overcompensation. +Pixelated bukkake. +A lifetime of sadness. +Racism. +Dwarf tossing. +Sunshine and rainbows. +A monkey smoking a cigar. +Flash flooding. +Lance Armstrong's missing testicle. +Dry heaving. +The terrorists. +Britney Spears at 55. +Attitude. +Breaking out into song and dance. +Leprosy. +Gloryholes. +Nipple blades. +The heart of a child. +Puppies! +Waking up half-naked in a Denny's parking lot. +Dental dams. +Toni Morrison's vagina. +The taint; the grundle; the fleshy fun-bridge. +Active listening. +Ethnic cleansing. +The Little Engine That Could. +The invisible hand. +Waiting ‘til marriage. +Unfathomable stupidity. +Euphoria by Calvin Klein. +Re-gifting. +Autocannibalism. +Erectile dysfunction. +My collection of high-tech sex toys. +The Pope. +White people. +Tentacle porn. +Glenn Beck convulsively vomiting as a brood of crab spiders hatches in his brain and erupts from his tear ducts. +Too much hair gel. +Seppuku. +Same-sex ice dancing. +Cheating in the Special Olympics. +Charisma. +Keanu Reeves. +Sean Penn. +Nickelback. +A look-see. +Pooping back and forth. Forever. +Menstruation. +Kids with ass cancer. +A salty surprise. +The South. +The violation of our most basic human rights. +YOU MUST CONSTRUCT ADDITIONAL PYLONS. +Date rape. +Being fabulous. +Necrophilia. +Centaurs. +Bill Nye the Science Guy. +Black people. +Chivalry. +Lunchables. +Bitches. +The profoundly handicapped. +Heartwarming orphans. +MechaHitler. +Fiery poops. +Another goddamn vampire movie. +Tangled Slinkys. +The true meaning of Christmas. +Estrogen. +A zesty breakfast burrito. +That thing that electrocutes your abs. +Passing a kidney stone. +A bleached asshole. +Michael Jackson. +Cybernetic enhancements. +Guys who don't call. +Smallpox blankets. +Masturbation. +Classist undertones. +Queefing. +Concealing a boner. +Edible underpants. +Viagra. +Soup that is too hot. +Muhammad (Praise Be Unto Him). +Surprise sex! +Five-Dollar Footlongs. +Drinking alone. +Dick fingers. +Multiple stab wounds. +Soiling oneself. +Child abuse. +Anal beads. +Civilian casualties. +Pulling out. +Robert Downey, Jr. +Horse meat. +A really cool hat. +Kim Jong-il. +A stray pube. +Jewish fraternities. +The token minority. +Doin' it in the butt. +Feeding Rosie O'Donnell. +Teaching a robot to love. +A can of whoop-ass. +A windmill full of corpses. +Count Chocula. +Wearing underwear inside-out to avoid doing laundry. +A death ray. +The glass ceiling. +A cooler full of organs. +The American Dream. +Keg stands. +When you fart and a little bit comes out. +Take-backsies. +Dead babies. +Foreskin. +Saxophone solos. +Italians. +A fetus. +Firing a rifle into the air while balls deep in a squealing hog. +Dick Cheney. +Amputees. +Eugenics. +My relationship status. +Christopher Walken. +Bees? +Harry Potter erotica. +College. +Getting drunk on mouthwash. +Nazis. +8 oz. of sweet Mexican black-tar heroin. +Stephen Hawking talking dirty. +Dead parents. +Object permanence. +Opposable thumbs. +Racially-biased SAT questions. +Jibber-jabber. +Chainsaws for hands. +Nicolas Cage. +Child beauty pageants. +Explosions. +Sniffing glue. +Glenn Beck being harried by a swarm of buzzards. +Repression. +Roofies. +My vagina. +Assless chaps. +A murder most foul. +Giving 110 percent. +Her Royal Highness, Queen Elizabeth II. +The Trail of Tears. +Being marginalized. +Goblins. +Hope. +The Rev. Dr. Martin Luther King, Jr. +A micropenis. +My soul. +A hot mess. +Vikings. +Hot people. +Seduction. +An Oedipus complex. +Geese. +Global warming. +New Age music. +Hot Pockets. +Making a pouty face. +Vehicular manslaughter. +Women's suffrage. +A defective condom. +Judge Judy. +African children. +The Virginia Tech Massacre. +Barack Obama. +Asians who aren't good at math. +Elderly Japanese men. +Exchanging pleasantries. +Heteronormativity. +Parting the Red Sea. +Arnold Schwarzenegger. +Road head. +Spectacular abs. +Figgy pudding. +A mopey zoo lion. +A bag of magic beans. +Poor life choices. +My sex life. +Auschwitz. +A snapping turtle biting the tip of your penis. +A thermonuclear detonation. +The clitoris. +The Big Bang. +Land mines. +Friends who eat all the snacks. +Goats eating cans. +The Dance of the Sugar Plum Fairy. +Jerking off into a pool of children's tears. +Man meat. +Me time. +The Underground Railroad. +Poorly-timed Holocaust jokes. +A sea of troubles. +Lumberjack fantasies. +Morgan Freeman's voice. +Women in yogurt commercials. +Natural male enhancement. +Being a motherfucking sorcerer. +Genital piercings. +Passable transvestites. +Sexy pillow fights. +Balls. +Grandma. +Friction. +Party poopers. +Farting and walking away. +Being a dick to children. +Booby-trapping the house to foil burglars. +The Tempur-Pedic Swedish Sleep System. +Dying. +Hurricane Katrina. +The gays. +The folly of man. +Men. +The Amish. +Pterodactyl eggs. +Team-building exercises. +A brain tumor. +Cards Against Humanity. +Fear itself. +Lady Gaga. +The milk man. +A foul mouth. +A big black dick. +A beached whale. +A bloody pacifier. +A crappy little hand. +A low standard of living. +A nuanced critique. +Panty raids. +A passionate Latino lover. +A rival dojo. +A web of lies. +A woman scorned. +Clams. +Apologizing. +Appreciative snapping. +Neil Patrick Harris. +Beating your wives. +Being a dinosaur. +Shaft. +Bosnian chicken farmers. +Nubile slave boys. +Carnies. +Coughing into a vagina. +Suicidal thoughts. +Dancing with a broom. +Deflowering the princess. +Dorito breath. +Eating an albino. +Enormous Scandinavian women. +Fabricating statistics. +Finding a skeleton. +Gandalf. +Genetically engineered super-soldiers. +George Clooney's musk. +Getting abducted by Peter Pan. +Getting in her pants, politely. +Gladiatorial combat. +Good grammar. +Hipsters. +Historical revisionism. +Insatiable bloodlust. +Jafar. +Jean-Claude Van Damme. +Just the tip. +Mad hacky-sack skills. +Leveling up. +Literally eating shit. +Making the penises kiss. +Media coverage. +Medieval Times Dinner and Tournament. +Moral ambiguity. +My machete. +One thousand Slim Jims. +Ominous background music. +Overpowering your father. +Pistol-whipping a hostage. +Quiche. +Quivering jowls. +Revenge fucking. +Ripping into a man's chest and pulling out his still-beating heart. +Ryan Gosling riding in on a white horse. +Santa Claus. +Scrotum tickling. +Sexual humiliation. +Sexy Siamese twins. +Slow motion. +Space muffins. +Statistically validated stereotypes. +Sudden Poop Explosion Disease. +The boners of the elderly. +The economy. +The Fanta girls. +The Gulags. +The harsh light of day. +The hiccups. +The shambling corpse of Larry King. +The four arms of Vishnu. +Being a busy adult with many important things to do. +Tripping balls. +Words, words, words. +Zeus's sexual appetites. \ No newline at end of file diff --git a/cards/question_cards b/cards/question_cards new file mode 100644 index 0000000..4f9b84e --- /dev/null +++ b/cards/question_cards @@ -0,0 +1,180 @@ +TSA guidelines now prohibit __________ on airplanes. +It's a pity that kids these days are all getting involved with __________. +In 1,000 years, when paper money is but a distant memory, __________ will be our currency. +Major League Baseball has banned __________ for giving players an unfair advantage. +What is Batman's guilty pleasure? +Next from J.K. Rowling: Harry Potter and the Chamber of __________. +I'm sorry, Professor, but I couldn't complete my homework because of __________. +What did I bring back from Mexico? +__________? There's an app for that. +__________. Betcha can't have just one! +What's my anti-drug? +While the United States raced the Soviet Union to the moon, the Mexican government funneled millions of pesos into research on __________. +In the new Disney Channel Original Movie, Hannah Montana struggles with __________ for the first time. +What's my secret power? +What's the new fad diet? +What did Vin Diesel eat for dinner? +When Pharaoh remained unmoved, Moses called down a Plague of __________. +How am I maintaining my relationship status? +What's the crustiest? +In L.A. County Jail, word is you can trade 200 cigarettes for __________. +After the earthquake, Sean Penn brought __________ to the people of Haiti. +Instead of coal, Santa now gives the bad children __________. +Life for American Indians was forever changed when the White Man introduced them to __________. +What's Teach for America using to inspire inner city students to succeed? +Maybe she's born with it. Maybe it's __________. +In Michael Jackson's final moments, he thought about __________. +White people like __________. +Why do I hurt all over? +A romantic, candlelit dinner would be incomplete without __________. +What will I bring back in time to convince people that I am a powerful wizard? +BILLY MAYS HERE FOR __________. +The class field trip was completely ruined by __________. +What's a girl's best friend? +Dear Abby, I'm having some trouble with __________ and would like your advice. +When I am President of the United States, I will create the Department of __________. +What are my parents hiding from me? +What never fails to liven up the party? +What gets better with age? +__________: Good to the last drop. +I got 99 problems but __________ ain't one. +__________. It's a trap! +MTV's new reality show features eight washed-up celebrities living with __________. +What would grandma find disturbing, yet oddly charming? +What's the most emo? +During sex, I like to think about __________. +What ended my last relationship? +What's that sound? +__________. That's how I want to die. +Why am I sticky? +What's the next Happy Meal toy? +What's there a ton of in heaven? +I do not know with what weapons World War III will be fought, but World War IV will be fought with __________. +What will always get you laid? +__________: Kid-tested, mother-approved. +Why can't I sleep at night? +What's that smell? +What helps Obama unwind? +This is the way the world ends / This is the way the world ends / Not with a bang but with __________. +Coming to Broadway this season, __________: The Musical. +Anthropologists have recently discovered a primitive tribe that worships __________. +But before I kill you, Mr. Bond, I must show you __________. +Studies show that lab rats navigate mazes 50% faster after being exposed to __________. +Next on ESPN2: The World Series of __________. +When I am a billionaire, I shall erect a 50-foot statue to commemorate __________. +In an attempt to reach a wider audience, the Smithsonian Museum of Natural History has opened an interactive exhibit on __________. +War! What is it good for? +What gives me uncontrollable gas? +What do old people smell like? +What am I giving up for Lent? +Alternative medicine is now embracing the curative powers of __________. +What did the US airdrop to the children of Afghanistan? +What does Dick Cheney prefer? +During Picasso's often-overlooked Brown Period, he produced hundreds of paintings of __________. +What don't you want to find in your Chinese food? +I drink to forget __________. +__________. High five, bro. +He who controls __________ controls the world. +The CIA now interrogates enemy agents by repeatedly subjecting them to __________. +In Rome, there are whisperings that the Vatican has a secret room devoted to __________. +Science will never explain the origin of __________. +When all else fails, I can always masturbate to __________. +I learned the hard way that you can't cheer up a grieving friend with __________. +In its new tourism campaign, Detroit proudly proclaims that it has finally eliminated __________. +The socialist governments of Scandinavia have declared that access to __________ is a basic human right. +In his new self-produced album, Kanye West raps over the sounds of __________. +What's the gift that keeps on giving? +This season on Man vs. Wild, Bear Grylls must survive in the depths of the Amazon with only __________ and his wits. +When I pooped, what came out of my butt? +In the distant future, historians will agree that __________ marked the beginning of America's decline. +What has been making life difficult at the nudist colony? +And I would have gotten away with it, too, if it hadn't been for __________. +What brought the orgy to a grinding halt? +__________. High five, bro. +TSA guidelines now prohibit __________ on airplanes. +It's a pity that kids these days are all getting involved with __________. +In 1,000 years, when paper money is but a distant memory, __________ will be our currency. +Major League Baseball has banned __________ for giving players an unfair advantage. +What is Batman's guilty pleasure? +Next from J.K. Rowling: Harry Potter and the Chamber of __________. +I'm sorry, Professor, but I couldn't complete my homework because of __________. +What did I bring back from Mexico? +__________? There's an app for that. +Betcha can't have just one! +What's my anti-drug? +While the United States raced the Soviet Union to the moon, the Mexican government funneled millions of pesos into research on __________. +In the new Disney Channel Original Movie, Hannah Montana struggles with __________ for the first time. +What's my secret power? +What's the new fad diet? +What did Vin Diesel eat for dinner? +When Pharaoh remained unmoved, Moses called down a Plague of __________. +How am I maintaining my relationship status? +What's the crustiest? +When I'm in prison, I'll have __________ smuggled in. +After Hurricane Katrina, Sean Penn brought __________ to the people of New Orleans. +Instead of coal, Santa now gives the bad children __________. +Life was difficult for cavemen before __________. +What's Teach for America using to inspire inner city students to succeed? +Who stole the cookies from the cookie jar? +In Michael Jackson's final moments, he thought about __________. +White people like __________. +Why do I hurt all over? +A romantic candlelit dinner would be incomplete without __________. +What will I bring back in time to convince people that I am a powerful wizard? +BILLY MAYS HERE FOR __________. +The class field trip was completely ruined by __________. +What's a girl's best friend? +I wish I hadn't lost the instruction manual for __________. +When I am President of the United States, I will create the Department of __________. +What are my parents hiding from me? +What never fails to liven up the party? +What gets better with age? +__________: good to the last drop. +I got 99 problems but __________ ain't one. +It's a trap! +MTV's new reality show features eight washed-up celebrities living with __________. +What would grandma find disturbing, yet oddly charming? +What's the most emo? +During sex, I like to think about __________. +What ended my last relationship? +What's that sound? +__________. That's how I want to die. +Why am I sticky? +What's the next Happy Meal toy? +What's there a ton of in heaven? +I do not know with what weapons World War III will be fought, but World War IV will be fought with __________. +What will always get you laid? +__________: kid tested, mother approved. +Why can't I sleep at night? +What's that smell? +What helps Obama unwind? +This is the way the world ends \ This is the way the world ends \ Not with a bang but with __________. +Coming to Broadway this season, __________: The Musical. +Anthropologists have recently discovered a primitive tribe that worships __________. +But before I kill you, Mr. Bond, I must show you __________. +Studies show that lab rats navigate mazes 50% faster after being exposed to __________. +Due to a PR fiasco, Walmart no longer offers __________. +When I am a billionaire, I shall erect a 50-foot statue to commemorate __________. +In an attempt to reach a wider audience, the Smithsonian Museum of Natural History has opened an interactive exhibit on __________. +War! What is it good for? +What gives me uncontrollable gas? +What do old people smell like? +Sorry everyone, I just __________. +Alternative medicine is now embracing the curative powers of __________. +The U.S. has begun airdropping __________ to the children of Afghanistan. +What does Dick Cheney prefer? +During Picasso's often-overlooked Brown Period, he produced hundreds of paintings of __________. +What don't you want to find in your Chinese food? +I drink to forget __________. +That's right, I killed __________. How, you ask? __________. +And the Academy Award for __________ goes to __________. +For my next trick, I will pull __________ out of __________. +In his new summer comedy, Rob Schneider is __________ trapped in the body of __________. +When I was tripping on acid, __________ turned into __________. +__________ is a slippery slope that leads to __________. +In a world ravaged by __________, our only solace is __________. +In M. Night Shyamalan's new movie, Bruce Willis discovers that __________ had really been __________ all along. +I never truly understood __________ until I encountered __________. +Rumor has it that Vladimir Putin's favorite dish is __________ stuffed with __________. +Lifetime presents __________, the story of __________. +What's the next superhero/sidekick duo? \ No newline at end of file diff --git a/plugin.py b/plugin.py index 401997d..b6f86c9 100644 --- a/plugin.py +++ b/plugin.py @@ -1,22 +1,54 @@ from random import choice +import os + +# Settings you change +card_folder = 'cards' +answer_cards_file_names = ['answer_cards', 'custom_anwser_cards'] +question_cards_file_name = ['question_cards', 'custom_question_cards'] + +# Settings that are used +base_directory = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)))) + class CardsAgainstHumanity(object): def __init__(self): - self.answerDb = ["Coat hanger abortions", "Man meat", "Autocannibalism", "Vigorous jazz hands", "Flightless birds", "Pictures of boobs", "Doing the right thing", "Hunting accidents", "A cartoon camel enjoying the smooth", "The violation of our most basic human rights", "Viagra", "Self-loathing", "Spectacular abs", "An honest cop with nothing left to lose", "Abstinence", "A balanced breakfast", "Mountain Dew Code Red", "Concealing a boner", "Roofies", "Tweeting"] - self.questionDb = ["Who is foo?"] + self.answerDb = self.parse_card_file('answer') + self.questionDb = self.parse_card_file('question') + + def parse_card_file(self, card_type): + card_type_map = {'answer': answer_cards_file_names, 'question': question_cards_file_name} + + # Read text file into a list containing only strings of text for the card + card_text_list = [] + for file_name in card_type_map[card_type]: + path = os.path.abspath(os.path.join(base_directory, card_folder, file_name)) + if os.path.exists(path): + with open(path) as file_handle: + file_data = file_handle.readlines() + card_text_list.extend(file_data) + if len(card_text_list) is 0: + raise IOError + + # Turn the strings of text into a Card object + card_object_list = [] + for index, card in enumerate(card_text_list): + card_object_list.append(Card(index, card_type, card)) + return card_object_list + + + def drawCard(self, typeOfCard): typeMap = {'answer': self.answerDb, 'question': self.questionDb} - cardType = typeMap[typeOfCard] - cardText = choice(cardType) - cardType.remove(cardText) - card = Card(1, typeOfCard, cardText) + type = typeMap[typeOfCard] + card = choice(type) + type.remove(card) return card class Card(object): - def __init__(self, cardId, cardType, cardText): - self.cardId = cardId - self.cardType = cardType - self.cardText = cardText + def __init__(self, id, type, text): + self.id = id + self.type = type + self.text = text class GameRound(CardsAgainstHumanity): def __init__(self): @@ -63,13 +95,13 @@ class PlayerHand(object): def showHand(self): for index, card in enumerate(self.cardList): - print '%s: %s' % (index + 1, card.cardText) + print '%s: %s' % (index + 1, card.text) if __name__=="__main__": deck = CardsAgainstHumanity() - print deck.drawCard('answer').cardText + print deck.drawCard('answer').text jazz_hand = PlayerHand(deck) bear_hand = PlayerHand(deck) print "Bear's hand:" diff --git a/test.py b/test.py index d2b43c7..a813e47 100644 --- a/test.py +++ b/test.py @@ -9,4 +9,13 @@ def test_cards_will_be_unique(): deck=CardsAgainstHumanity() hand_one = PlayerHand(deck) for card in hand_one.cardList: - assert card.cardText not in deck.answerDb + assert card.text not in deck.answerDb + +def test_card_parsing(): + deck = CardsAgainstHumanity() + for card in deck.answerDb: + assert type(card) is Card + assert type(card.id) is int + assert type(card.type) is str + assert card.type in ['answer', 'question'] + assert type(card.text) is str