Ejemplo n.º 1
0
#add breakpoint to test your data
breakpoint()
#view the data in your variables to ensure they are correct


# 2
# use the greeting method from my_module to print out your name
print(my_module.greeting('Matt'))
#add breakpoint to test your data
breakpoint()
#view the data in your variables to ensure they are correct


# 3
# use the letter_text module to print out a string
print(my_module.letter_text(name="Matt",amount="$100",denomination="USD"))
#add breakpoint to test your data
breakpoint()
#view the data in your variables to ensure they are correct


# 4
# use the my_module.my_json_data and print it out
print(my_module.my_json_data)
#add breakpoint to test your data
breakpoint()
#view the data in your variables to ensure they are correct


# 5
# import the my_json_data as my_data and print out the my_json_data using pprint
Ejemplo n.º 2
0
import pprint

import my_module

from my_module import my_json_data as my_data

from my_module import my_json_data
# 1. import my_module and the pretty print module
# Add a breakpoint to test data
pdb.set_trace()

# 2. Use the gretting method from my_module to print out your name
greet = my_module.greeting("Eugene")
print(greet)
pdb.set_trace()

# 3. Use the letter_text module to print out a string
letter = my_module.letter_text(name="Sam",
                               amount="10,000",
                               denomination="dollars")
print(letter)
pdb.set_trace()

# 4. Use the my_module.my_json.data and print it out
print(my_json_data)
pdb.set_trace()

# 5. Import the my_json_data as my_data and print out the my_data using pretty print
pprint.pprint(my_data)
pdb.set_trace()
Ejemplo n.º 3
0
def test_letter_text_fail():
    """
    Testing letter_text function from my_module for fail
    """
    assert my_module.letter_text(name="Matt", amount="100") != \
        "Hello Matt, this letter is to inform you that you have won 100 USD.", "test failed"
Ejemplo n.º 4
0
def test_letter_text_pass():
    """
    Testing letter_text function from my_module for pass
    """
    assert my_module.letter_text(name="Matt", amount="100", denomination="USD") == \
        "Hello Matt, this letter is to inform you that you have won 100 USD.", "test failed"
Ejemplo n.º 5
0
def test_letter_text():
    assert "Hello Sam, this letter is to inform you that you have won 10,000 dollars" == letter_text(name="Sam", amount="10,000", denomination="dollars"), "Test Failed"
    assert "nothing" != letter_text(name="Sam", amount="10,000", denomination="dollars"), "Test Failed"
    
Ejemplo n.º 6
0
my_module.greeting("Jordan")

breakpoint()

# 3. Use letter_text function to print a string
# Add breakpoint to test your data
# View the data in your variables to check

kwargs = {
    'name': 'Jordan',
    'amount': '500',
    'denomination': 'dollars',
}

my_module.letter_text(**kwargs)

breakpoint()

# 4. Import  my_json_data and print
# Add breakpoint to test your data
# View the data in your variables to check

from my_module import my_json_data
print(my_json_data)

breakpoint()

# 5. Import my_json_data as my_data and print using prettyprint
# Add breakpoint to test your data
# View the data in your variables to check