async def pound_countdown( bot): # Background task to countdown to when the pound opens await bot.wait_until_ready( ) # Wait until bot has loaded before starting background task while not bot.is_closed(): # While bot is still running if not Variables.cooldown: # If command is not on cooldown data = await cs.get_pound_string() # Get pound text pound_type = data[0] string = data[1] seconds = cs.get_pound_time(string) # Extract total seconds seconds, sleep_amount, send_msg = library.calculate_sleep_amount( seconds) if send_msg: # If sending message is needed time = round(seconds / 60) if time in Variables.autoremind_times: channel_ids = await library.get_sending_channels(time) for channel in channel_ids: sending_channel = bot.get_channel(channel) messages = await library.prepare_message( channel, time, pound_type) try: for message in messages: await sending_channel.send(message) except (AttributeError, discord.errors.Forbidden): pass await asyncio.sleep(sleep_amount) # Sleep for sleep amount
def test_no_times(self): assert ( get_pound_time( "Sorry, the pound is closed at the moment.The pound closed less than three hours ago! The pound opens at totally random times of day, so check back later to try again :)" ) == 0 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment.The pound closed less than two hours ago! The pound opens at totally random times of day, so check back later to try again :)" ) == 0 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment.The pound closed less than one hour ago! The pound opens at totally random times of day, so check back later to try again :)" ) == 0 ) assert get_pound_time("Pound is currently open!") == 0
def test_hour_only_strings(self): assert get_pound_time('Sorry, the pound is closed at the moment. The pound will open within 6 hours') == 21600 assert get_pound_time('Sorry, the pound is closed at the moment. The pound will open within 5 hours') == 18000 assert get_pound_time('Sorry, the pound is closed at the moment. The pound will open within 4 hours') == 14400 assert get_pound_time('Sorry, the pound is closed at the moment. The pound will open within 3 hours') == 10800 assert get_pound_time('Sorry, the pound is closed at the moment. The pound will open in: 2 hours') == 7200 assert get_pound_time('Sorry, the pound is closed at the moment. The pound will open in: 1 hour') == 3600
async def get(self, ctx): if not self.generating_image: pound_data = await cs.get_pound_string() if pound_data[0] == 'Lost and Found' or pound_data[ 0] == 'Pound & Lost and Found': await ctx.send('The next opening is not the Pound!') elif pound_data[ 0] == 'Pound' and 'Pound is currently open!' in pound_data[ 1]: await ctx.send( 'An image cannot be generated while the pound is still open!' ) elif Constants.image_exists: await ctx.send( 'An image has already been created! Use `,ppets` to display it!' ) else: await ctx.send( 'Generating image... Enter the command again to view the progress' ) self.generating_image = True headers = { # HTTP request headers 'User-Agent': 'CS Pound Discord Bot Agent ' + Constants.version, # Connecting User-Agent 'From': Constants.contact_email } login_url = 'https://www.chickensmoothie.com/Forum/ucp.php?mode=login' payload = { 'username': Constants.username, 'password': Constants.password, 'redirect': 'index.php', 'sid': '', 'login': '******' } self.session = aiohttp.ClientSession(headers=headers) await self.session.post(login_url, data=payload) pound_account = Constants.pound_pets_group async with aiohttp.ClientSession(headers=headers) as session: async with session.get(pound_account) as response: if response.status == 200: connection = await response.text() dom = lxml.html.fromstring(connection) dom.make_links_absolute( 'https://www.chickensmoothie.com') self.stage = 1 last_page = dom.xpath('//div[@class="pages"]')[0].xpath( 'a/@href')[-2] pet_count = int( parse_qs(urlparse(last_page).query)['pageStart'][0]) all_pets = [] for i in range(40): page_start = pet_count - (20 * i) url = pound_account + '&pageStart=' + str(page_start) print(f'Parsing {url}') async with self.session.get( url ) as response: # POST the variables to the base php link if response.status == 200: # If received response is OK connection = await response.text( ) # Get text HTML of site await asyncio.sleep(0.5) dom = lxml.html.fromstring( connection) # Convert into DOM pets = dom.xpath('//dl[@class="pet"]') all_pets.extend(pets) self.all_rare_pets = 0 rare_plus_pets = [] for pet in all_pets: image_url = pet.xpath('dt//img/@src')[0] rarity = pet.xpath('dd[last()]//img/@alt')[0] try: adoption_date = pet.xpath('dd/span/span/text()')[0] except IndexError: print("RAN INTO ERROR") adoption_date = "" if rarity == 'Rare' or rarity == 'Very rare' or rarity == 'OMG so rare!': rare_plus_pets.append( (image_url, rarity, adoption_date)) self.all_rare_pets = len(rare_plus_pets) self.stage = 2 self.parsed_pets = 0 image_data = [] async with aiohttp.ClientSession( ) as session: # Create an AIOHTTP session for (image, _, _) in rare_plus_pets: print(image) async with session.post(image, headers=headers) as response: if response.status == 200: content = await response.read() content = io.BytesIO(content) image_data.append(content) self.parsed_pets += 1 await asyncio.sleep(0.5) self.stage = 3 _, max_height = generate_image(1920, 1080, image_data, rare_plus_pets) canvas, _ = generate_image(1920, max_height, image_data, rare_plus_pets) output_buffer = io.BytesIO( ) # Convert the PIL output into bytes canvas.save(output_buffer, 'png') # Save the bytes as a PNG format base64_string = base64.b64encode(output_buffer.getvalue()) expiration_date = datetime.datetime.now() + datetime.timedelta( hours=1, seconds=cs.get_pound_time(pound_data[1])) await collection.insert_one({ 'generated': True, 'image_base64': base64_string, 'expiration_date': expiration_date }) self.generating_image = False self.stage = 0 Constants.image_exists = True else: # The command is currently generating the image message = 'Another user already ran this command!\nCurrent status: ' if self.stage == 1: message += 'Collecting pets to check...' elif self.stage == 2: message += f'Checking pets... ({self.parsed_pets}/{self.all_rare_pets} pets checked)' elif self.stage == 3: message += 'Generating image...' await ctx.send(message)
async def get(self, ctx): if not self.generating_image: pound_data = await cs.get_pound_string() if (pound_data[0] == "Lost and Found" or pound_data[0] == "Pound & Lost and Found"): await ctx.send("The next opening is not the Pound!") elif (pound_data[0] == "Pound" and "Pound is currently open!" in pound_data[1]): await ctx.send( "An image cannot be generated while the pound is still open!" ) elif Constants.image_exists: await ctx.send( "An image has already been created! Use `,ppets` to display it!" ) else: await ctx.send( "Generating image... Enter the command again to view the progress" ) self.generating_image = True headers = { # HTTP request headers "User-Agent": "CS Pound Discord Bot Agent " + Constants.version, # Connecting User-Agent "From": Constants.contact_email, } login_url = "https://www.chickensmoothie.com/Forum/ucp.php?mode=login" payload = { "username": Constants.username, "password": Constants.password, "redirect": "index.php", "sid": "", "login": "******", } self.session = aiohttp.ClientSession(headers=headers) await self.session.post(login_url, data=payload) self.stage = 1 all_pets = [] pound_account = Constants.pound_pets_group async with self.session as session: async with session.get(pound_account) as response: if response.status == 200: connection = await response.text() dom = lxml.html.fromstring(connection) dom.make_links_absolute( "https://www.chickensmoothie.com") all_pets = dom.xpath('//dl[@class="pet"]') self.stage = 1 self.all_rare_pets = 0 rare_plus_pets = [] for pet in all_pets: image_url = pet.xpath("dt//img/@src")[0] try: rarity = pet.xpath("dd[last()]//img/@alt")[0] except IndexError: # Pet does not have rarity (Still growing) rarity = "Unknown" try: adoption_date = pet.xpath("dd/span/span/text()")[0] except IndexError: print("RAN INTO ERROR") adoption_date = "" if (rarity == "Rare" or rarity == "Very rare" or rarity == "OMG so rare!"): rare_plus_pets.append( (image_url, rarity, adoption_date)) self.all_rare_pets = len(rare_plus_pets) self.stage = 2 self.parsed_pets = 0 image_data = [] async with aiohttp.ClientSession( ) as session: # Create an AIOHTTP session for (image, _, _) in rare_plus_pets: async with session.get(image, headers=headers) as response: if response.status == 200: content = await response.read() content = io.BytesIO(content) image_data.append(content) self.parsed_pets += 1 await asyncio.sleep(0.5) self.stage = 3 _, max_height = generate_image(1920, 1080, image_data, rare_plus_pets) canvas, _ = generate_image(1920, max_height, image_data, rare_plus_pets) output_buffer = io.BytesIO( ) # Convert the PIL output into bytes canvas.save(output_buffer, "png") # Save the bytes as a PNG format base64_string = base64.b64encode(output_buffer.getvalue()) expiration_date = datetime.datetime.now() + datetime.timedelta( hours=1, seconds=cs.get_pound_time(pound_data[1])) await collection.insert_one({ "generated": True, "image_base64": base64_string, "expiration_date": expiration_date, }) self.generating_image = False self.stage = 0 Constants.image_exists = True else: # The command is currently generating the image message = "Another user already ran this command!\nCurrent status: " if self.stage == 1: message += "Collecting pets to check..." elif self.stage == 2: message += f"Checking pets... ({self.parsed_pets}/{self.all_rare_pets} pets checked)" elif self.stage == 3: message += "Generating image..." await ctx.send(message)
def test_minute_only_strings(self): assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 60 minutes" ) == 3600 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 59 minutes" ) == 3540 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 58 minutes" ) == 3480 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 57 minutes" ) == 3420 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 56 minutes" ) == 3360 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 55 minutes" ) == 3300 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 54 minutes" ) == 3240 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 53 minutes" ) == 3180 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 52 minutes" ) == 3120 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 51 minutes" ) == 3060 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 50 minutes" ) == 3000 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 49 minutes" ) == 2940 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 48 minutes" ) == 2880 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 47 minutes" ) == 2820 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 46 minutes" ) == 2760 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 45 minutes" ) == 2700 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 44 minutes" ) == 2640 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 43 minutes" ) == 2580 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 42 minutes" ) == 2520 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 41 minutes" ) == 2460 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 40 minutes" ) == 2400 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 39 minutes" ) == 2340 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 38 minutes" ) == 2280 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 37 minutes" ) == 2220 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 36 minutes" ) == 2160 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 35 minutes" ) == 2100 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 34 minutes" ) == 2040 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 33 minutes" ) == 1980 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 32 minutes" ) == 1920 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 31 minutes" ) == 1860 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 30 minutes" ) == 1800 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 29 minutes" ) == 1740 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 28 minutes" ) == 1680 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 27 minutes" ) == 1620 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 26 minutes" ) == 1560 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 25 minutes" ) == 1500 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 24 minutes" ) == 1440 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 23 minutes" ) == 1380 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 22 minutes" ) == 1320 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 21 minutes" ) == 1260 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 20 minutes" ) == 1200 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 19 minutes" ) == 1140 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 18 minutes" ) == 1080 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 17 minutes" ) == 1020 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 16 minutes" ) == 960 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 15 minutes" ) == 900 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 14 minutes" ) == 840 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 13 minutes" ) == 780 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 12 minutes" ) == 720 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 11 minutes" ) == 660 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 10 minutes" ) == 600 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 9 minutes" ) == 540 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 8 minutes" ) == 480 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 7 minutes" ) == 420 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 6 minutes" ) == 360 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 5 minutes" ) == 300 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 4 minutes" ) == 240 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 3 minutes" ) == 180 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 2 minutes" ) == 120 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will in: 1 minute" ) == 60 )
def test_hour_and_minute_strings(self): assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 60 minutes" ) == 7200 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 59 minutes" ) == 7140 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 58 minutes" ) == 7080 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 57 minutes" ) == 7020 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 56 minutes" ) == 6960 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 55 minutes" ) == 6900 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 54 minutes" ) == 6840 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 53 minutes" ) == 6780 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 52 minutes" ) == 6720 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 51 minutes" ) == 6660 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 50 minutes" ) == 6600 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 49 minutes" ) == 6540 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 48 minutes" ) == 6480 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 47 minutes" ) == 6420 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 46 minutes" ) == 6360 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 45 minutes" ) == 6300 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 44 minutes" ) == 6240 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 43 minutes" ) == 6180 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 42 minutes" ) == 6120 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 41 minutes" ) == 6060 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 40 minutes" ) == 6000 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 39 minutes" ) == 5940 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 38 minutes" ) == 5880 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 37 minutes" ) == 5820 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 36 minutes" ) == 5760 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 35 minutes" ) == 5700 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 34 minutes" ) == 5640 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 33 minutes" ) == 5580 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 32 minutes" ) == 5520 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 31 minutes" ) == 5460 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 30 minutes" ) == 5400 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 29 minutes" ) == 5340 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 28 minutes" ) == 5280 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 27 minutes" ) == 5220 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 26 minutes" ) == 5160 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 25 minutes" ) == 5100 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 24 minutes" ) == 5040 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 23 minutes" ) == 4980 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 22 minutes" ) == 4920 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 21 minutes" ) == 4860 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 20 minutes" ) == 4800 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 19 minutes" ) == 4740 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 18 minutes" ) == 4680 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 17 minutes" ) == 4620 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 16 minutes" ) == 4560 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 15 minutes" ) == 4500 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 14 minutes" ) == 4440 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 13 minutes" ) == 4380 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 12 minutes" ) == 4320 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 11 minutes" ) == 4260 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 10 minutes" ) == 4200 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 9 minutes" ) == 4140 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 8 minutes" ) == 4080 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 7 minutes" ) == 4020 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 6 minutes" ) == 3960 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 5 minutes" ) == 3900 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 4 minutes" ) == 3840 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 3 minutes" ) == 3780 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 2 minutes" ) == 3720 ) assert ( get_pound_time( "Sorry, the pound is closed at the moment. The pound will open in: 1 hour, 1 minute" ) == 3660 )